using INTEX.DataBase.Tools;
using System.Data;
using System.Data.OracleClient;
using System.Text;
namespace WPFExcelReport
{
    public partial class VEKPOS
    {

        public void SetUpNewRow(ref DataRow dwReturn, DataRow dwInput)
        {
            #region
            #endregion
            switch (app.company)
            {
                case "YGR":
                case "YCC":
                case "TST":
                case "UBT":
                default:
                    #region
                    dwReturn["EKPSA"] = "PO";
                    dwReturn["EKPMANDANT"] = app.Mandant;
                    dwReturn["EKPAUFKRS"] = "  ";
                    dwReturn["EKPAUFLFD"] = "000000";
                    dwReturn["EKPAUFPOS"] = "000";
                    dwReturn["EKPAENDST"] = "000";
                    dwReturn["EKPAENZL"] = "3";
                    dwReturn["EKPAENB"] = "        ";
                    dwReturn["EKPAEND"] = "0";
                    dwReturn["EKPNEUB"] = "        ";
                    dwReturn["EKPNEUD"] = "0";
                    dwReturn["EKPAUFGRP"] = "B";
                    dwReturn["EKPAUFART"] = "BE";
                    dwReturn["EKPARTGR"] = "1";
                    dwReturn["EKPKUNDNR"] = "        ";
                    dwReturn["EKPWERK"] = "   ";
                    dwReturn["EKPABT"] = "   ";
                    dwReturn["EKPWAKZ"] = " ";
                    dwReturn["PART"] = "".PadRight(20);
                    dwReturn["PVAR"] = "".PadRight(3);
                    dwReturn["PFARBE"] = "".PadRight(10);
                    dwReturn["EKPART"] = Encoding.Default.GetBytes(" ".PadRight(20));
                    dwReturn["EKPVAR"] = Encoding.Default.GetBytes(" ".PadRight(3));
                    dwReturn["EKPFARBE"] = Encoding.Default.GetBytes(" ".PadRight(10));
                    dwReturn["EKPDESS"] = "          ";
                    dwReturn["EKPCOL"] = "          ";
                    dwReturn["EKPBESCH"] = "          ";
                    dwReturn["EKPZUSTAND"] = "    ";
                    dwReturn["EKPGROE"] = "       ";
                    dwReturn["EKPSCHLIGR"] = "     ";
                    dwReturn["EKPSCHLINR"] = "000000000000000";
                    dwReturn["EKPLSART"] = "                    ";
                    dwReturn["EKPLSVAR"] = "   ";
                    dwReturn["EKPLSFB"] = "          ";
                    dwReturn["EKPLSDESS"] = "          ";
                    dwReturn["EKPLSCOL"] = "          ";
                    dwReturn["EKPLSBE"] = "          ";
                    dwReturn["EKPLSZUSTAND"] = "    ";
                    dwReturn["EKPLSGROE"] = "       ";
                    dwReturn["EKPLSGRPBEZ"] = "                    ";
                    dwReturn["EKPLSARTBEZ"] = "                                        ";
                    dwReturn["EKPSTKLGV"] = "0";
                    dwReturn["EKPSTKLGB"] = "0";
                    dwReturn["EKPPRKZ"] = " ";
                    dwReturn["EKPPRUEF"] = "    ";
                    dwReturn["EKPMATKOMPDR"] = "N";
                    dwReturn["EKPPARTIE"] = "       ";
                    dwReturn["EKPSPUL"] = "0";
                    dwReturn["EKPSPULG"] = "0";
                    dwReturn["EKPSPULM"] = "0";
                    dwReturn["EKPVPEINH"] = "    ";
                    dwReturn["EKPAM"] = "SM";
                    dwReturn["EKPZUSAM"] = "  ";
                    dwReturn["EKPHUELSE"] = "      ";
                    dwReturn["EKPKF"] = " ";
                    dwReturn["EKPFDRES"] = " ";
                    dwReturn["EKPWI"] = " ";
                    dwReturn["EKPANZTKB"] = "0";
                    dwReturn["EKPLOSGR"] = "0";
                    dwReturn["EKPWIRKGEW"] = "0";
                    dwReturn["EKPVKUNDNR"] = "        ";
                    dwReturn["EKPVWERK"] = "   ";
                    dwReturn["EKPVABT"] = "   ";
                    dwReturn["EKPVART"] = Encoding.Default.GetBytes(" ".PadRight(20));
                    dwReturn["EKPVVAR"] = Encoding.Default.GetBytes(" ".PadRight(3));
                    dwReturn["EKPVFARBE"] = Encoding.Default.GetBytes(" ".PadRight(10));
                    dwReturn["EKPEKUNDNR"] = "        ";
                    dwReturn["EKPEWERK"] = "   ";
                    dwReturn["EKPEABT"] = "   ";
                    dwReturn["EKPEART"] = "                    ";
                    dwReturn["EKPEVAR"] = "   ";
                    dwReturn["EKPEFARBE"] = "          ";
                    dwReturn["EKPEDESS"] = "          ";
                    dwReturn["EKPECOL"] = "          ";
                    dwReturn["EKPEBESCH"] = "          ";
                    dwReturn["EKPEZUSTAND"] = "    ";
                    dwReturn["EKPEGROE"] = "       ";
                    dwReturn["EKPMINLIME"] = "0";
                    dwReturn["EKPMINLISP"] = "0";
                    dwReturn["EKPMEEH"] = "KG ";
                    dwReturn["EKPMEEHGRP"] = "4";
                    dwReturn["EKPMEEHFKT"] = "000001000000";
                    dwReturn["EKPME1"] = "0";
                    dwReturn["EKPME2"] = "0";
                    dwReturn["EKPME3"] = "0";
                    dwReturn["EKPME4"] = "0";
                    dwReturn["EKPME5"] = "0";
                    dwReturn["EKPME6"] = "0";
                    dwReturn["EKPME7"] = "0";
                    dwReturn["EKPME8"] = "0";
                    dwReturn["EKPME9"] = "0";
                    dwReturn["EKPMEO"] = "0";
                    dwReturn["EKPMEU"] = "0";
                    dwReturn["EKPSMENGE"] = "0";
                    dwReturn["EKPWE1"] = "0";
                    dwReturn["EKPWE2"] = "0";
                    dwReturn["EKPWE3"] = "0";
                    dwReturn["EKPWE4"] = "0";
                    dwReturn["EKPWE5"] = "0";
                    dwReturn["EKPWE6"] = "0";
                    dwReturn["EKPWE7"] = "0";
                    dwReturn["EKPWE8"] = "0";
                    dwReturn["EKPWE9"] = "0";
                    dwReturn["EKPBDAT"] = "0";
                    dwReturn["EKPLTERM"] = "0";
                    dwReturn["EKPFIX"] = " ";
                    dwReturn["EKPLDAT"] = "00.00.00";
                    dwReturn["EKPDRUDAT"] = "0";
                    dwReturn["EKPWVTERM"] = "0";
                    dwReturn["EKPWUTERM"] = "0";
                    dwReturn["EKPVEINDAT"] = "0";
                    dwReturn["EKPVEINDALT"] = "0";
                    dwReturn["EKPLTERMBE"] = "0";
                    dwReturn["EKPLTERMKZ"] = " ";
                    dwReturn["EKPVTERMIN"] = "0";
                    dwReturn["EKPVTERMEIN"] = "        ";
                    dwReturn["EKPDATVON"] = "0";
                    dwReturn["EKPBEDAT"] = "0";
                    dwReturn["EKPTERMTAB"] = "    ";
                    dwReturn["EKPTERMIND"] = "0";
                    dwReturn["EKPSOLLDAT1"] = "0";
                    dwReturn["EKPISTDAT1"] = "0";
                    dwReturn["EKPSOLLDAT2"] = "0";
                    dwReturn["EKPISTDAT2"] = "0";
                    dwReturn["EKPSOLLDAT3"] = "0";
                    dwReturn["EKPISTDAT3"] = "0";
                    dwReturn["EKPSOLLDAT4"] = "0";
                    dwReturn["EKPISTDAT4"] = "0";
                    dwReturn["EKPSOLLDAT5"] = "0";
                    dwReturn["EKPISTDAT5"] = "0";
                    dwReturn["EKPSOLLDAT6"] = "0";
                    dwReturn["EKPISTDAT6"] = "0";
                    dwReturn["EKPLRUECK"] = "0";
                    dwReturn["EKPPRME"] = "0000000000";
                    dwReturn["EKPPREH"] = "   ";
                    dwReturn["EKPPREHGRP"] = "4";
                    dwReturn["EKPPREHFKT"] = "000001000000";
                    dwReturn["EKPPRDR"] = " ";
                    dwReturn["EKPPREISKZ"] = "  ";
                    dwReturn["EKPPREISLST"] = "     ";
                    dwReturn["EKPRABATTKZ"] = " ";
                    dwReturn["EKPRABATT"] = "0";
                    dwReturn["EKPRABART1"] = "   ";
                    dwReturn["EKPRABPROZ1"] = "0";
                    dwReturn["EKPRABWERT1"] = "0";
                    dwReturn["EKPRABART2"] = "   ";
                    dwReturn["EKPRABPROZ2"] = "0";
                    dwReturn["EKPRABWERT2"] = "0";
                    dwReturn["EKPRABART3"] = "   ";
                    dwReturn["EKPRABPROZ3"] = "0";
                    dwReturn["EKPRABWERT3"] = "0";
                    dwReturn["EKPRABART4"] = "   ";
                    dwReturn["EKPRABPROZ4"] = "0";
                    dwReturn["EKPRABWERT4"] = "0";
                    dwReturn["EKPRABART5"] = "   ";
                    dwReturn["EKPRABPROZ5"] = "0";
                    dwReturn["EKPRABWERT5"] = "0";
                    dwReturn["EKPZUAB1"] = "   ";
                    dwReturn["EKPZUABPR1"] = "0";
                    dwReturn["EKPZUABWE1"] = "0";
                    dwReturn["EKPZUABME1"] = "   ";
                    dwReturn["EKPABRKZ1"] = " ";
                    dwReturn["EKPZUAB2"] = "   ";
                    dwReturn["EKPZUABPR2"] = "0";
                    dwReturn["EKPZUABWE2"] = "0";
                    dwReturn["EKPZUABME2"] = "   ";
                    dwReturn["EKPABRKZ2"] = " ";
                    dwReturn["EKPZUAB3"] = "   ";
                    dwReturn["EKPZUABPR3"] = "0";
                    dwReturn["EKPZUABWE3"] = "0";
                    dwReturn["EKPZUABME3"] = "   ";
                    dwReturn["EKPABRKZ3"] = " ";
                    dwReturn["EKPZUAB4"] = "   ";
                    dwReturn["EKPZUABPR4"] = "0";
                    dwReturn["EKPZUABWE4"] = "0";
                    dwReturn["EKPZUABME4"] = "   ";
                    dwReturn["EKPABRKZ4"] = " ";
                    dwReturn["EKPZUAB5"] = "   ";
                    dwReturn["EKPZUABPR5"] = "0";
                    dwReturn["EKPZUABWE5"] = "0";
                    dwReturn["EKPZUABME5"] = "   ";
                    dwReturn["EKPABRKZ5"] = " ";
                    dwReturn["EKPZUABWERT"] = "0";
                    dwReturn["EKPFIXBONP"] = "0";
                    dwReturn["EKPFIXBONA"] = "0";
                    dwReturn["EKPKALBONP"] = "0";
                    dwReturn["EKPKALBONA"] = "0";
                    dwReturn["EKPCOUPON"] = " ";
                    dwReturn["EKPKOKRS"] = "  ";
                    dwReturn["EKPKOLFD"] = "      ";
                    dwReturn["EKPKOPOS"] = "   ";
                    dwReturn["EKPSTA"] = "  ";
                    dwReturn["EKPSTAKZ"] = " ";
                    dwReturn["EKPMAHNKZ"] = "  ";
                    dwReturn["EKPMAHNKZA"] = "  ";
                    dwReturn["EKPMAHNDAT"] = "0";
                    dwReturn["EKPKTOKL4"] = "000000";
                    dwReturn["EKPKSTKRS"] = "  ";
                    dwReturn["EKPKST"] = "0000";
                    dwReturn["EKPBUDGET"] = "        ";
                    dwReturn["EKPINVAUF"] = "00000000";
                    dwReturn["EKPFAUFTYP"] = " ";
                    dwReturn["EKPFAUFKRS"] = "  ";
                    dwReturn["EKPFAUFLFD"] = "000000";
                    dwReturn["EKPFAUFPOS"] = "000";
                    dwReturn["EKPANRKR"] = "  ";
                    dwReturn["EKPALFDNR"] = "000000";
                    dwReturn["EKPWAEHRSL"] = "RMB";
                    dwReturn["EKPKURS"] = "10000";
                    dwReturn["EKPBETRAG"] = "1";
                    dwReturn["EKPHWAEHRSL"] = "RMB";
                    dwReturn["EKPHEUROKURS"] = "0";
                    dwReturn["EKPHEUROKURSVK"] = " ";
                    dwReturn["EKPFEUROKURS"] = "0";
                    dwReturn["EKPFEUROKURSVK"] = " ";
                    dwReturn["EKPTERMNR"] = "0";
                    dwReturn["EKPFAELLIG"] = "0";
                    dwReturn["EKPSICHER"] = "0";
                    dwReturn["EKPSICHP"] = "0";
                    dwReturn["EKPAKKRED"] = "               ";
                    dwReturn["EKPUDATUM"] = "0";
                    dwReturn["EKPUAENZL"] = "0";
                    dwReturn["EKPUAENB"] = "        ";
                    dwReturn["EKPLIEFNR"] = "00000010";
                    dwReturn["EKPKONDSL"] = "STD ";
                    dwReturn["EKPLO"] = "01";
                    dwReturn["EKPLB"] = "  ";
                    dwReturn["EKPLPLATZ"] = "        ";
                    dwReturn["EKPLIEFERSCH"] = "        ";
                    dwReturn["EKPZOLLSL"] = " ";
                    dwReturn["EKPIMEXSL"] = " ";
                    dwReturn["EKPKNTRNRL"] = "               ";
                    dwReturn["EKPLIEFKOMP"] = " ";
                    dwReturn["EKPABRUF"] = " ";
                    dwReturn["EKPSACHB"] = "        ";
                    dwReturn["EKPLEBKZ"] = " ";
                    dwReturn["EKPSPERR"] = " ";
                    dwReturn["EKPWIEBEST"] = "        ";
                    dwReturn["EKPBEKZ"] = " ";
                    dwReturn["EKPPOSTYP"] = "   ";
                    dwReturn["EKPGESSTA"] = "  ";
                    dwReturn["EKPEINSTA"] = "10";
                    dwReturn["EKPZENSUR"] = " ";
                    dwReturn["EKPTEXTKON"] = "              ";
                    dwReturn["EKPMCODE"] = "              ";
                    dwReturn["EKPGENBENID1"] = "        ";
                    dwReturn["EKPGENDAT1"] = "0";
                    dwReturn["EKPGENBENID2"] = "        ";
                    dwReturn["EKPGENDAT2"] = "0";
                    dwReturn["EKPGENBENID3"] = "        ";
                    dwReturn["EKPGENDAT3"] = "0";
                    dwReturn["EKPGENSTUFE"] = "0";
                    dwReturn["EKPGENOFFEN"] = "        ";
                    dwReturn["EKPABLADEST"] = "    ";
                    dwReturn["EKPVERBENID"] = "        ";
                    dwReturn["EKPWEMAIL"] = " ";
                    dwReturn["EKPURLAND"] = "   ";
                    dwReturn["EKPETIDR"] = " ";
                    dwReturn["EKPCHAR"] = "0";
                    dwReturn["EKPGNR"] = "0";
                    dwReturn["EKPZUARTF"] = "   ";
                    dwReturn["EKPZUABPRF"] = "0";
                    dwReturn["EKPZUABWEF"] = "0";
                    dwReturn["EKPMEEHF"] = "   ";
                    dwReturn["EKPABRKZF"] = " ";
                    dwReturn["EKPZUARTV"] = "   ";
                    dwReturn["EKPZUABPRV"] = "0";
                    dwReturn["EKPZUABWEV"] = "0";
                    dwReturn["EKPMEEHV"] = "   ";
                    dwReturn["EKPABRKZV"] = " ";
                    dwReturn["EKPVERSICH"] = "0";
                    dwReturn["EKPEDIKZ"] = " ";
                    dwReturn["EKPKOMMNR"] = "                    ";
                    dwReturn["EKPKOMMPOS"] = "0000";
                    dwReturn["EKPEDIDAT"] = "0";
                    dwReturn["EKPEDIZEIT"] = "0";
                    dwReturn["EKPURBESTPOS"] = "000";
                    dwReturn["EKPVERTRNRK"] = "                    ";
                    dwReturn["EKPVERTRPOSK"] = "0000";
                    dwReturn["EKPTERMSTA"] = "20";
                    dwReturn["EKPKONTSTA"] = "30";
                    dwReturn["EKPZUABSTA"] = "40";
                    dwReturn["EKPEXMANDANT"] = "  ";
                    dwReturn["EKPWVTERMVG"] = " ";
                    dwReturn["EKPFILLER14"] = "000000000000000000     00000000 00000000       000000000                ";

                    #endregion
                    break;
            }
            INTEXDBC.MapData(true, ref dwReturn, dwInput);
        }

        public void MapEKPOS(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }

        public void SaveEKPOS(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryEKPOS(dwData, 1);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            //MapEKPOS(ref dwLocal, dwData);
            //Because contains the RAW data in the databaes, so the dwData will not map to the dwLoacl
            //sunlight 20130815
            if (!flgExist)
            {
                InsertEKPOS(dwData);
            }
            UpdateEKPOS(dwData);
        }

        public DataSet QueryEKPOS(DataRow dwData, int option = 1)
        {

            switch (option)
            {
                case 0:
                    SResult = QEK00(dwData);
                    break;
                case 1:
                    SResult = QEK01(dwData);
                    break;
                case 2:
                    SResult = QEK02(dwData);
                    break;
                case 3:
                    SResult = QEK03(dwData);
                    break;
                case 4:
                    SResult = QEK04(dwData);
                    break;
                case 5:
                    SResult = QEK05(dwData);
                    break;
                case 6:
                    SResult = QEK06(dwData);
                    break;
                case 7:
                    SResult = QEK07(dwData);
                    break;
                case 8:
                    SResult = QEK08(dwData);
                    break;
                case 9:
                    SResult = QEK09(dwData);
                    break;
                case 10:
                    SResult = QEK10(dwData);
                    break;
                case 11:
                    SResult = QEK11(dwData);
                    break;
                case 901:
                    SResult = QEK901(dwData);
                    break;
                case 902:
                    SResult = QEK902(dwData);
                    break;
                case 903:
                    SResult = QEK903(dwData);
                    break;
                case 99:
                    SResult = QEK99(dwData);
                    break;
                default:
                    break;
            }
            return SResult;
        }

        public DataSet QEK02(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT NVL(LSLIEFNA,' ') AS LSLIEFNA, EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,utl_raw.cast_to_varchar2(EKPART) AS PART,utl_raw.cast_to_varchar2(EKPVAR) AS PVAR,utl_raw.cast_to_varchar2(EKPFARBE) AS PFARBE, P.*  FROM EKPOS P "
                + " LEFT JOIN LIEFDAT ON LSMANDANT=EKPMANDANT AND EKPLIEFNR=LSLIEFNR"
               + " WHERE  ( EKPSA='PO' OR EKPSA='IN') AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK03(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,EKPAUFKRS,EKPAUFLFD,EKPAUFPOS,ABAVKAUFKRS,ABAVKAUFLFD,ABAVKAUFPOS,MU.ABAART,MU.ABAVAR,MU.ABAFARBE, ABAGROE,EK.EKPPRME*0.001 AS PRICE,EKPPREH AS UM,WAFGRLFD,EKPME1,EKPME3 FROM EKPOS EKJOIN ICC_ABAUFM MU ON MU.ABAAUFKRS=EK.EKPAUFKRS AND MU.ABAAUFLFD=EK.EKPAUFLFD AND MU.ABAAUFPOS=EK.EKPAUFPOS"
            + " WHERE  EKPSA='PO' AND ABAMANDANT=:ABAMANDANT: AND MU.ABAVKAUFKRS=:ABAVKAUFKRS: AND MU.ABAVKAUFLFD=:ABAVKAUFLFD: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK04(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,EKPAUFKRS,EKPAUFLFD,EKPAUFPOS,ABAVKAUFKRS,ABAVKAUFLFD,ABAVKAUFPOS,MU.ABAART,MU.ABAVAR,MU.ABAFARBE, ABAGROE,EK.EKPPRME*0.001 AS PRICE,EKPPREH AS UM,WAFGRLFD,EKPME1,EKPME3 FROM EKPOS EK"
            + " JOIN ICC_ABAUFM MU ON MU.ABAAUFKRS=EK.EKPAUFKRS AND MU.ABAAUFLFD=EK.EKPAUFLFD AND MU.ABAAUFPOS=EK.EKPAUFPOS"
            + " WHERE  EKPSA='PO' AND ABAMANDANT=:ABAMANDANT: AND MU.ABAVKAUFKRS=:ABAVKAUFKRS: AND MU.ABAVKAUFLFD=:ABAVKAUFLFD: AND ABAVKAUFPOS=:ABAVKAUFPOS: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK05(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            string EKPBEKZ = dwData["EKPBEKZ"].ToString();
            string EKPKNTRNRL = dwData["EKPKNTRNRL"].ToString();
            or1.CommandText = "SELECT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,EKPMANDANT,EKPAUFKRS,EKPAUFLFD,EKPAUFPOS,EKPNEUD,EKPNEUB,EKPARTGR, "
            + " EKPWAKZ,EKPBEKZ,EKPLIEFNR,EKPWE1,EKPLTERM,EKPME1,EKPMEEH,EKPPRME,EKPLSGRPBEZ "
            + " ,EKPZUAB1,EKPZUABPR1,EKPZUABWE1,EKPZUABME1,EKPABRKZ1,EKPZUAB2,EKPZUABPR2, "
            + " EKPZUABWE2,EKPZUABME2,EKPABRKZ2,EKPZUAB3,EKPZUABPR3, "
            + " EKPZUABWE3,EKPZUABME3  ,EKPABRKZ3,EKPZUAB4,EKPZUABPR4,EKPZUABWE4,EKPZUABME4, "
            + " EKPABRKZ4,EKPZUAB5,EKPZUABPR5,EKPZUABWE5, "
            + " EKPZUABME5  ,EKPABRKZ5,  EKPZUABWERT,EKPKNTRNRL "
            + " ,  utl_raw.cast_to_varchar2(EKPART) AS EKPART   ,  utl_raw.cast_to_varchar2(EKPVAR) AS EKPVAR   , utl_raw.cast_to_varchar2(EKPFARBE) AS EKPFARBE,EKPDESS,EKPCOL,EKPGROE "
            + "  FROM EKPOS P WHERE EKPSA<>'AJ' AND EKPMANDANT=:EKPMANDANT:  AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD:"
            + "  AND EKPBEKZ IN ( " + EKPBEKZ + ")  "
            + "  AND ( trim(EKPKNTRNRL) IS " + EKPKNTRNRL + " NULL "
            + "  or EXISTS (SELECT '1' FROM EKVRECH A "
            + "  WHERE A.EKVMANDANT = P.EKPMANDANT  "
            + "  AND TRIM(A.EKVFILLER)  = P.EKPAUFKRS||'-'||P.EKPAUFLFD||'-'||P.EKPAUFPOS "
            + "  AND A.EKVKIR='K'  AND '" + EKPKNTRNRL + "' = 'NOT')) ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK06(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,EKPMANDANT,EKPAUFKRS,EKPAUFLFD,EKPAUFPOS,EKPNEUD,EKPNEUB,EKPARTGR,EKPWAKZ,EKPWE1,EKPLTERM,EKPME1,EKPMEEH,EKPPRME"
                                + ",  utl_raw.cast_to_varchar2(EKPART) AS EKPART"
                                + ",  utl_raw.cast_to_varchar2(EKPVAR) AS EKPVAR"
                                + ", utl_raw.cast_to_varchar2(EKPFARBE) AS EKPFARBE,EKPDESS,EKPCOL,EKPGROE "
                               + "  FROM EKPOS P WHERE    EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK07(DataRow dwData)
        {
            string FSARTPRGR = "";
            string FROMDATE = "";
            string ENDDATE = "";
            string FKRS = "";
            string FLFD = "";
            string ART = "";
            or1 = OracleDB.CreateCommand();
            FROMDATE = dwData["EKPAEND"].ToString().Trim();
            ENDDATE = dwData["EKPNEUD"].ToString().Trim();
            FKRS = dwData["EKPAUFKRS"].ToString().Trim();
            FLFD = dwData["EKPAUFLFD"].ToString().Trim();
            ART = dwData["EKPKNTRNRL"].ToString().Trim();
            or1.CommandText = "SELECT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,A.EKPAUFKRS, A.EKPAUFLFD, TO_NUMBER(A.EKPLIEFNR) AS SUPP, TRIM(C.LSNAME2) AS SUPPNAME, TRIM(B.GSART) AS YARN, TRIM(B.GSHANDLNR) AS YARNDES,"
              + " DECODE(SUBSTR(EKPFILLER14, 1, 8), '00000000', '', SUBSTR(EKPFILLER14, 1, 8)) AS LASTDAT, D.EKKBDAT,"
              + " TRIM(D.EKKKNTRNRL) || TRIM(D.EKKAKKRED) || TRIM(D.EKKZEICH) AS SCHNO, A.EKPME1 * 0.01 AS ORDERQTY, A.EKPME3 * 0.01 AS INQTY, (CASE WHEN A.EKPME1 < A.EKPME3 THEN"
              + " 0 ELSE (A.EKPME1 - A.EKPME3) * 0.01 END) AS REMAINQTY FROM EKPOS A, GSDAT B, LIEFDAT C, EKKOPF D"
              + " WHERE A.EKPSA = 'PO'"
              + " AND A.EKPMANDANT = B.GSMANDANT AND utl_raw.cast_to_varchar2(A.EKPART) = B.GSART"
              + " AND utl_raw.cast_to_varchar2(A.EKPVAR) = B.GSVAR"
              + " AND A.EKPMANDANT = C.LSMANDANT"
              + " AND A.EKPLIEFNR = C.LSLIEFNR"
              + " AND A.EKPMANDANT = D.EKKMANDANT"
              + " AND A.EKPAUFKRS = D.EKKAUFKRS"
              + " AND A.EKPAUFLFD = D.EKKAUFLFD"
              + " AND ( D.EKKBDAT >= " + FROMDATE + " AND D.EKKBDAT <= " + ENDDATE + " )"
              + " AND ( A.EKPAUFKRS = '" + FKRS + "' OR '" + FKRS + "'='AA' ) "
              + " AND ( A.EKPAUFLFD  = '" + FLFD + "' OR '" + FLFD + "'='000000' ) "
              + " AND ( TRIM(D.EKKKNTRNRL) || TRIM(D.EKKAKKRED) || TRIM(D.EKKZEICH)  LIKE'%" + ART + "%' )"
              ;

            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK08(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,utl_raw.cast_to_varchar2(EKPART) AS PART,utl_raw.cast_to_varchar2(EKPVAR) AS PVAR,utl_raw.cast_to_varchar2(EKPFARBE) AS PFARBE, P.*  FROM EKPOS P "
                   + " WHERE   EKPSA=:EKPSA: AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK09(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,LSLIEFNA,EKKWAEHRSL,SUBSTR(EKKKOMMNR,1,3) AS LIEFBED,ABAVKAUFKRS||ABAVKAUFLFD||ABAVKAUFPOS AS ABAVKAUF,SUBSTR(EKKKOMMNR,4,3) AS SART,SUBSTR(EKKKOMMNR,7,3) AS VSPED,SUBSTR(EKKKOMMNR,10,3) AS ZAHLBED,EKKEINSTA,EKKLIEFNR,EKKAUFKRS,EKKAUFLFD,EKKAUFART,(SELECT TRIM(SUBSTR(SDDATEN,2,20)) FROM SDDAT WHERE SDSA ='8884' AND SDKEY LIKE '00'||EKKAUFART||'%V') AS TYP, EKKSACHB,utl_raw.cast_to_varchar2(EKPART) AS PART,utl_raw.cast_to_varchar2(EKPVAR) AS PVAR,utl_raw.cast_to_varchar2(EKPFARBE) AS PFARBE, P.*  "
                + ",VKZZUART1,VKZZUABWERT1,VKZRABART1,VKZVERPWERT1,VKZZUART2,VKZZUABWERT2,VKZRABART2,VKZVERPWERT2,VKZZUART3,VKZZUABWERT3,VKZRABART3,VKZVERPWERT3, "
              + "+VRPZUABWERT1*0.01 AS SUR1,VRPZUABWERT2*0.01 AS SUR2, VRPZUABWERT3*0.01 AS SUR3, "
                 + "+(VRPZUABWERT1+VRPZUABWERT2+VRPZUABWERT3+VRPZUABWERT4+VRPZUABWERT5)*0.01 AS SUR, "
                + " +(VRPRABWERT1+VRPRABWERT2+VRPRABWERT3+VRPRABWERT4+VRPRABWERT5)*0.01 AS DIS, VRPROHWERT AS VALUE, "
                + "  (SELECT MAX(TRIM(S.KDKUNDNA)) FROM VKKOPF K,KDSTAMM S WHERE K.VKKMANDANT = S.KDMANDANT AND K.VKKKUNDNR = S.KDKUNDNR AND K.VKKAUFKRS = ABAVKAUFKRS "
                + "  AND K.VKKAUFLFD =ABAVKAUFLFD ) AS CUSTOMER, "
                + " (SELECT MAX(TRIM(VKPKOLL))FROM VKPOS V WHERE V.VKPAUFKRS = A.ABAVKAUFKRS AND V.VKPAUFLFD = A.ABAVKAUFLFD AND V.VKPAUFPOS = A.ABAVKAUFPOS AND V.VKPSA='  ')  AS KOLL "
                + " FROM  EKPOS P JOIN EKKOPF ON EKPMANDANT=EKKMANDANT AND EKPAUFKRS=EKKAUFKRS AND EKPAUFLFD=EKKAUFLFD "
                + " LEFT JOIN ABAUFM A ON ABAMANDANT=EKPMANDANT AND ABAAUFKRS=EKPAUFKRS AND ABAAUFLFD=EKPAUFLFD AND ABAAUFPOS=EKPAUFPOS AND ABAAPOS='0002' "
                   + " LEFT JOIN VKZUAB ON VKZMANDANT=EKPMANDANT AND VKZSA='EK' AND VKZAUFKRS=EKPAUFKRS AND VKZAUFLFD=EKPAUFLFD AND VKZAUFPOS=EKPAUFPOS "
                    + " JOIN LIEFDAT ON LSLIEFNR=EKPLIEFNR "
                     + "LEFT JOIN VRPOS ON VRPMANDANT=EKPMANDANT AND VRPSTATIST='B' AND RTRIM(VRPZOLLTNR)='0:100' AND VRPAUFKRS=EKPAUFKRS AND VRPAUFLFD=EKPAUFLFD AND VRPAUFPOS=EKPAUFPOS"
                    //+ " LEFT JOIN VKPOS ON VKPAUFKRS=ABAVKAUFKRS AND VKPAUFLFD=ABAVKAUFLFD AND VKPAUFPOS=ABAVKAUFPOS "
                    //+ " JOIN VKKOPF ON VKKAUFKRS=ABAVKAUFKRS AND VKKAUFLFD=ABAVKAUFLFD"
                         + " WHERE (EKPSA='PO' OR EKPSA='IN') AND  EKPMANDANT=:EKPMANDANT: "
                   + dwData["EKPAUFKRS"].ToString()
                   + dwData["EKPAUFLFD"].ToString()
                   + dwData["EKPAUFPOS"].ToString()
                   + dwData["EKPLIEFNR"].ToString();
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK0901(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM (SELECT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,LSLIEFNA,EKKWAEHRSL,SUBSTR(EKKKOMMNR,1,3) AS LIEFBED,ABAVKAUFKRS||ABAVKAUFLFD||ABAVKAUFPOS AS ABAVKAUF,SUBSTR(EKKKOMMNR,4,3) AS SART,SUBSTR(EKKKOMMNR,7,3) AS VSPED,SUBSTR(EKKKOMMNR,10,3) AS ZAHLBED,EKKEINSTA,EKKLIEFNR,EKKAUFKRS,EKKAUFLFD,EKKAUFART,(SELECT TRIM(SUBSTR(SDDATEN,2,20)) FROM SDDAT WHERE SDSA ='8884' AND SDKEY LIKE '00'||EKKAUFART||'%V') AS TYP, EKKSACHB,utl_raw.cast_to_varchar2(EKPART) AS PART,utl_raw.cast_to_varchar2(EKPVAR) AS PVAR,utl_raw.cast_to_varchar2(EKPFARBE) AS PFARBE, P.*  "
                + ",VKZZUART1,VKZZUABWERT1,VKZRABART1,VKZVERPWERT1,VKZZUART2,VKZZUABWERT2,VKZRABART2,VKZVERPWERT2,VKZZUART3,VKZZUABWERT3,VKZRABART3,VKZVERPWERT3, "
                 + "+VRPZUABWERT1*0.01 AS SUR1,VRPZUABWERT2*0.01 AS SUR2, VRPZUABWERT3*0.01 AS SUR3, "
                 + "+(VRPZUABWERT1+VRPZUABWERT2+VRPZUABWERT3+VRPZUABWERT4+VRPZUABWERT5)*0.01 AS SUR, "
                + " +(VRPRABWERT1+VRPRABWERT2+VRPRABWERT3+VRPRABWERT4+VRPRABWERT5)*0.01 AS DIS, VRPROHWERT * 0.001 AS VALUE, "
                + "  (SELECT MAX(TRIM(S.KDKUNDNA)) FROM VKKOPF K,KDSTAMM S WHERE K.VKKMANDANT = S.KDMANDANT AND K.VKKKUNDNR = S.KDKUNDNR AND K.VKKAUFKRS = ABAVKAUFKRS "
                + "  AND K.VKKAUFLFD =ABAVKAUFLFD ) AS CUSTOMER, "
                + " (SELECT MAX(TRIM(VKPKOLL))FROM VKPOS V WHERE V.VKPAUFKRS = A.ABAVKAUFKRS AND V.VKPAUFLFD = A.ABAVKAUFLFD AND V.VKPAUFPOS = A.ABAVKAUFPOS AND V.VKPSA='  ')  AS KOLL "
                + " FROM  EKPOS P JOIN EKKOPF ON EKPMANDANT=EKKMANDANT AND EKPAUFKRS=EKKAUFKRS AND EKPAUFLFD=EKKAUFLFD "
                     + " LEFT JOIN ABAUFM A ON ABAMANDANT=EKPMANDANT AND ABAAUFKRS=EKPAUFKRS AND ABAAUFLFD=EKPAUFLFD AND ABAAUFPOS=EKPAUFPOS AND ABAAPOS='0002' "
                        + " LEFT JOIN VKZUAB ON VKZMANDANT=EKPMANDANT AND VKZSA='EK' AND VKZAUFKRS=EKPAUFKRS AND VKZAUFLFD=EKPAUFLFD AND VKZAUFPOS=EKPAUFPOS "
                         + " JOIN LIEFDAT ON LSLIEFNR=EKPLIEFNR "
                          + " JOIN VRPOS ON VRPMANDANT=EKPMANDANT AND VRPSTATIST='B' AND RTRIM(VRPZOLLTNR)='0:100' AND VRPAUFKRS=EKPAUFKRS AND VRPAUFLFD=EKPAUFLFD AND VRPAUFPOS=EKPAUFPOS"
                         //+ " LEFT JOIN VKPOS ON VKPAUFKRS=ABAVKAUFKRS AND VKPAUFLFD=ABAVKAUFLFD AND VKPAUFPOS=ABAVKAUFPOS "
                         //+ " JOIN VKKOPF ON VKKAUFKRS=ABAVKAUFKRS AND VKKAUFLFD=ABAVKAUFLFD"
                         + " WHERE (EKPSA='PO' OR EKPSA='IN') AND  EKPMANDANT=:EKPMANDANT: "
                   + dwData["EKPAUFKRS"].ToString()
                   + dwData["EKPAUFLFD"].ToString()
                   + dwData["EKPAUFPOS"].ToString()
                   + dwData["EKPLIEFNR"].ToString();
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        //
        public DataSet QEK10(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,EKKLIEFNR,EKKAUFKRS,EKKAUFLFD, EKKSACHB,utl_raw.cast_to_varchar2(EKPART) AS PART,utl_raw.cast_to_varchar2(EKPVAR) AS PVAR,utl_raw.cast_to_varchar2(EKPFARBE) AS PFARBE, P.* "
                        + " FROM EKPOS P  JOIN EKKOPF ON EKPMANDANT=EKKMANDANT AND EKPAUFKRS=EKKAUFKRS AND EKPAUFLFD=EKKAUFLFD"
                         + " JOIN ABAUFM ON ABAAUFTYP='B' AND ABAMANDANT=EKPMANDANT AND ABAAUFKRS=EKPAUFKRS AND ABAAUFLFD=EKPAUFLFD AND ABAAUFPOS=EKPAUFPOS"
                       + " WHERE  ( EKPSA='PO' OR EKPSA='IN')  AND ABAMANDANT=:ABAMANDANT:  AND ABAVKAUFKRS=:ABAVKAUFKRS: AND ABAVKAUFLFD=:ABAVKAUFLFD:"
                       + " ORDER BY EKPAUFKRS,EKPAUFLFD,EKPAUFPOS";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK901(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();

            or1.CommandText = "SELECT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,LSLIEFNA,FSKOLL,FSARTPRGR,SUM(EKPME1*0.01) AS EKPME1,EKPMEEH,SUM(EKPWE1*0.01) AS EKPWE1 FROM EKPOS JOIN"
            + " (SELECT DISTINCT ABAMANDANT,ABPART,FSARTPRGR,FSKOLL,ABAAUFKRS,ABAAUFLFD,ABAAUFPOS FROM ICC_ABAUFM"
            + " WHERE ABAMANDANT=:ABAMANDANT: AND FSKOLL=:FSKOLL:  AND FSARTPRGR IN(" + dwData["ABPART"].ToString().Trim() + ") ) A ON"
            + "  ABAMANDANT=EKPMANDANT AND ABAAUFKRS=EKPAUFKRS AND ABAAUFLFD=EKPAUFLFD AND ABAAUFPOS=EKPAUFPOS  "
            + " JOIN LIEFDAT ON LSLIEFNR=EKPLIEFNR"
            + "   WHERE EKPMANDANT=:ABAMANDANT: AND EKPSA='PO' "
            + "  GROUP BY LSLIEFNA,ABPART,FSKOLL,FSARTPRGR,EKPMEEH"
            + " ORDER BY FSKOLL,FSARTPRGR,LSLIEFNA ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK902(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();

            or1.CommandText = "SELECT Z.*,NVL(LS.LSNAME1,Z.LSLIEFNR) AS LSNAME1 FROM ("
            + "SELECT  FSSZUSCHN,FSARTPRGR,MTYPE,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE,ABAAUFKRS,ABAAUFLFD,ABAAUFPOS,MAX(EKPME3) AS EKPME3,"
            + " MAX(EKPNEUB) AS EKPNEUB,MAX(EKPME1) AS EKPME1,MAX(EKPWE1) AS EKPWE1,MAX(EKPBEKZ) AS EKPBEKZ,MAX(EKPBEDAT) AS EKPBEDAT,MAX(EKPKNTRNRL) AS EKPKNTRNRL,MAX(EKPVTERMIN) AS EKPVTERMIN,"
            + "MAX(REPDAT) AS REPDAT,MAX(WAUEBM) AS WAUEBM, CASE WHEN  MAX(WAUEBM)='KG' THEN ROUND(SUM(ABARESMG*WAFGRLFD*0.001),1) ELSE SUM(ABARESMG) END AS ABARESMG,CASE WHEN  MAX(WAUEBM)='KG' THEN ROUND(SUM(ABAQTYRESERVE*WAFGRLFD*0.001),1) ELSE SUM(ABAQTYRESERVE) END AS ABAQTYRESERVE,MAX(FSABEZ) AS FSABEZ ,MAX(FSFFBEZ) AS FSFFBEZ, LSLIEFNR,MAX(EXART) AS EXART,MAX(EXCOLOR) AS EXCOLOR "
            + " FROM (SELECT  FSSZUSCHN,FSARTPRGR,MTYPE,WAUEBM,WAFGRLFD,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE,ABAAUFKRS,ABAAUFLFD,ABAAUFPOS,EKPME3*0.01 AS EKPME3,  EKPNEUB,EKPME1*0.01 AS EKPME1,EKPWE1*0.01 AS EKPWE1, EKPBEKZ,  EKPBEDAT,SUBSTR(EKPKNTRNRL,1,8) AS EKPKNTRNRL,  EKPVTERMIN,SUBSTR(EKPFILLER14,1,8) AS REPDAT,  ABARESMG,  ABAQTYRESERVE,FSABEZ,FSFFBEZ,NVL(EKPLIEFNR,X.LSLIEFNR) AS LSLIEFNR,EXART,EXCOLOR "
            + " FROM ICC_ABAUFM X LEFT JOIN EKPOS ON EKPSA='PO' AND EKPAUFKRS=ABAAUFKRS AND EKPAUFLFD=ABAAUFLFD AND EKPAUFPOS=ABAAUFPOS "
            + "  WHERE ABAMANDANT=:ABAMANDANT: AND FSKOLL LIKE '%" + dwData["FSKOLL"].ToString().Trim() + "%'   AND FSARTPRGR IN(" + dwData["FSABEZ"].ToString().Trim() + ") "
             + "  AND ABPART LIKE '" + dwData["ABPART"].ToString().Trim()
             + "%' AND ABAART LIKE '%" + dwData["ABAART"].ToString().Trim() + "%'  ) Y "
             + " GROUP BY  FSSZUSCHN,FSARTPRGR,MTYPE,LSLIEFNR,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE,ABAAUFKRS,ABAAUFLFD,ABAAUFPOS ) Z"
             + "  LEFT JOIN LIEFDAT LS ON  LS.LSLIEFNR=Z.LSLIEFNR "
             + " ORDER BY FSARTPRGR,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE,LSNAME1";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK903(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT  ABAMANDANT,  FSSZUSCHN,'      ' AS PTYE  ,  MTYPE  ,'    ' AS PMTYP,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE,ABAAUFKRS,ABAAUFLFD,ABAAUFPOS,ABAVKAUFKRS,ABAVKAUFLFD,SUM(EKPME1)*0.01 AS EKPME1,SUM(EKPWE1)*0.01 AS EKPWE1,MAX(EKPBEKZ) AS EKPBEKZ,MAX(EKPBEDAT) AS EKPBEDAT,SUBSTR(MAX(EKPKNTRNRL),1,8) AS EKPKNTRNRL,MAX(EKPVTERMIN) AS EKPVTERMIN,SUBSTR(MAX(EKPFILLER14),1,8) AS REPDAT,SUM(ABARESMG) AS ABARESMG,SUM(ABAQTYRESERVE) AS ABAQTYRESERVE,MAX(FSABEZ) AS FSABEZ ,MAX(FSFFBEZ) AS FSFFBEZ,LSNAME1,MAX(EXART) AS EXART,MAX(EXCOLOR) AS EXCOLOR FROM ICC_ABAUFM  LEFT JOIN EKPOS ON EKPSA='PO' AND EKPAUFKRS=ABAAUFKRS AND EKPAUFLFD=ABAAUFLFD AND EKPAUFPOS=ABAAUFPOS  LEFT JOIN LIEFDAT LS ON LS.LSLIEFNR=EKPLIEFNR"
               + " WHERE ABAMANDANT=:ABPMANDANT: AND ABAVKAUFKRS=:ABPAUFKRS: AND ABAVKAUFLFD=:ABPAUFLFD: AND ABPFARBE=:ABPFARBE: GROUP BY ABAMANDANT,FSSZUSCHN,MTYPE, LSNAME1,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE,ABAAUFKRS,ABAAUFLFD,ABAAUFPOS,ABAVKAUFKRS,ABAVKAUFLFD ORDER BY ABAMANDANT,LSNAME1,ABPART,ABPFARBE,ABAART,ABAFARBE,ABAGROE";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK99(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,EKPAUFKRS,EKPAUFLFD,EKPAUFPOS,ABAVKAUFKRS,ABAVKAUFLFD,ABAVKAUFPOS,MU.ABAART,MU.ABAVAR,MU.ABAFARBE,ABAGROE,EK.EKPPRME*0.001 AS PRICE,EKPPREH AS UM,WAFGRLFD FROM EKPOS EK"
             + " JOIN ICC_ABAUFM MU ON MU.ABAAUFKRS=EK.EKPAUFKRS AND MU.ABAAUFLFD=EK.EKPAUFLFD AND MU.ABAAUFPOS=EK.EKPAUFPOS"
             + " WHERE EKPSA='PO' AND MU.ABAVKAUFKRS=:ABAVKAUFKRS: AND MU.ABAVKAUFLFD=:ABAVKAUFLFD: AND "
             + " MU.ABAART=:ABAART: AND MU.ABAVAR=:ABAVAR: AND MU.ABAFARBE=:ABAFARBE: AND ABAGROE=:ABAGROE:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK00(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM EKPOS WHERE  ROWNUM<2 ";
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK01(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,utl_raw.cast_to_varchar2(EKPART) AS PART,utl_raw.cast_to_varchar2(EKPVAR) AS PVAR,utl_raw.cast_to_varchar2(EKPFARBE) AS PFARBE,P.* FROM EKPOS P WHERE EKPSA<>'AJ'  AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS:  ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK11(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,EKKLIEFNR,EKKAUFKRS,EKKAUFLFD, EKKSACHB,utl_raw.cast_to_varchar2(EKPART) AS PART,utl_raw.cast_to_varchar2(EKPVAR) AS PVAR,utl_raw.cast_to_varchar2(EKPFARBE) AS PFARBE, P.* "
               + " FROM EKPOS P  JOIN EKKOPF ON EKPMANDANT=EKKMANDANT AND EKPAUFKRS=EKKAUFKRS AND EKPAUFLFD=EKKAUFLFD"
                + " JOIN ABAUFM ON ABAAUFTYP='B' AND ABAMANDANT=EKPMANDANT AND ABAAUFKRS=EKPAUFKRS AND ABAAUFLFD=EKPAUFLFD AND ABAAUFPOS=EKPAUFPOS"
              + " WHERE  ( EKPSA='PO' OR EKPSA='IN')  AND ABAMANDANT=:ABAMANDANT: "
              + dwData["ABAVKAUFKRS"].ToString()
              + " ORDER BY EKPAUFKRS,EKPAUFLFD,EKPAUFPOS";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }

        public DataSet QEK12(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT EKPPRME*0.001*EKPME1*0.01 AS BUVALUE,EKKLIEFNR,EKKAUFKRS,EKKAUFLFD, EKKSACHB,utl_raw.cast_to_varchar2(EKPART) AS PART,utl_raw.cast_to_varchar2(EKPVAR) AS PVAR,utl_raw.cast_to_varchar2(EKPFARBE) AS PFARBE, P.* "
                + " FROM GABEW Y JOIN (SELECT X.GABMANDANT, X.GABAUFKRS, X.GABAUFLFD, X.GABAUFPOS FROM(SELECT DISTINCT GABLBEHI FROM GABEW WHERE GABAUFKRS = :EKPAUFKRS: AND GABAUFLFD = :EKPAUFLFD: AND GABAUFPOS = :EKPAUFPOS:  AND GABBS = 38) Z"
                + " JOIN GABEW X ON Z.GABLBEHI = X.GABLBEHI AND X.GABBS = 13) W    ON Y.GABMANDANT = W.GABMANDANT AND Y.GABAUFKRS = W.GABAUFKRS AND Y.GABAUFLFD = W.GABAUFLFD AND Y.GABAUFPOS = W.GABAUFPOS AND Y.GABBS = 38"
                + " JOIN GPDAT H ON GPMANDANT = W.GABMANDANT AND GABPARTIE = GPPARTIE "
                + " JOIN EKPOS P ON H.GPMANDANT = EKPMANDANT AND EKPSA = 'PO' AND EKPAUFKRS = GPBESTKRS AND EKPAUFLFD = GPBESTLFD AND EKPAUFPOS = GPBESTPOS"
                + " JOIN EKKOPF ON EKPMANDANT=EKKMANDANT AND EKPAUFKRS=EKKAUFKRS AND EKPAUFLFD=EKKAUFLFD"
                  + " JOIN LIEFDAT ON LSLIEFNR=EKPLIEFNR"
                ;
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK13(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT TO_NUMBER(A.EKPAUFPOS) AS POS,utl_raw.cast_to_varchar2(EKPART) AS ART,W.WABEZ AS ARTDES,utl_raw.cast_to_varchar2(EKPFARBE) AS COLOR,WAFMINPMENG, "
                + " EKPME1*0.01 AS QTY,TRIM(A.EKPMEEH) AS UNIT,EKPPRME*0.001 AS PRICE,EKPPREH, "
                + " DECODE(EKPGENDAT1,0,'',TO_CHAR(TO_DATE(EKPGENDAT1,'YYYYMMDD'),'MON-DD,YYYY')) AS SDAT, "
                + " DECODE(EKPLTERM,0,'',TO_CHAR(TO_DATE(EKPLTERM,'YYYYMMDD'),'MON-DD,YYYY')) AS BDAT, "
                + " W.WAFBRTU*0.1 AS TOTWID,W.WAFBRTL*0.1 AS WID,W.WAFGRLFD AS GM,W.WAFGRQM AS SQM, "
                + " (SELECT MAX(TRIM(VAAFILLER)) FROM VAART WHERE VAAMANDANT = W.WAMANDANT AND VAADART = W.WAART) AS COMP, "
                + " EKPME1*0.01*EKPPRME*0.001 AS VAL,A.EKPME1*0.01*to_number(A.EKPPRME)*0.001+(B.vkzzuabproz1+B.vkzzuabproz2+B.vkzzuabproz3+B.vkzzuabproz4+B.vkzzuabproz5)*0.0001*  "
                + " A.EKPME1*0.01*to_number(A.EKPPRME)*0.001+(B.vkzzuabwert1+B.vkzzuabwert2+B.vkzzuabwert3+B.vkzzuabwert4+B.vkzzuabwert5)*0.01 -  "
                + " (B.vkzrabproz1+B.vkzrabproz2+B.vkzrabproz3+B.vkzrabproz4+B.vkzrabproz5)*0.0001*A.EKPME1*0.01*to_number(A.EKPPRME)*0.001-  "
                + " (B.vkzverpwert1+B.vkzverpwert2+B.vkzverpwert3+B.vkzverpwert4+B.vkzverpwert5)*0.01 as value, "
                + " (B.vkzzuabproz1+B.vkzzuabproz2+B.vkzzuabproz3+B.vkzzuabproz4+B.vkzzuabproz5)*0.0001* "
                + " A.EKPME1*0.01*to_number(A.EKPPRME)*0.001+(B.vkzzuabwert1+B.vkzzuabwert2+B.vkzzuabwert3+B.vkzzuabwert4+B.vkzzuabwert5)*0.01  AS SUR, "
                + " (B.vkzrabproz1+B.vkzrabproz2+B.vkzrabproz3+B.vkzrabproz4+B.vkzrabproz5)*0.0001*A.EKPME1*0.01*to_number(A.EKPPRME)*0.001+  "
                + " (B.vkzverpwert1+B.vkzverpwert2+B.vkzverpwert3+B.vkzverpwert4+B.vkzverpwert5)*0.01 as DIS "
                + " FROM EKPOS A,WASTAMM W,VKZUAB B "
                + " WHERE A.EKPSA = 'PO' AND A.EKPMANDANT = B.VKZMANDANT AND A.EKPAUFKRS = B.VKZAUFKRS  "
                + " AND A.EKPAUFLFD = B.VKZAUFLFD AND A.EKPAUFPOS = B.VKZAUFPOS AND B.VKZSA = 'EK' "
                + " AND A.EKPMANDANT = W.WAMANDANT AND utl_raw.cast_to_varchar2(EKPART) = W.WAART "
                + " AND EKPMANDANT = :EKPMANDANT: AND EKPAUFKRS =:EKPAUFKRS: AND EKPAUFLFD =:EKPAUFLFD: "
                + " ORDER BY 1 "
                ;
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QEK14(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT LSLIEFNA,SUBSTR(EKKKOMMNR,1,3) AS LIEFBED,ABAVKAUFKRS||ABAVKAUFLFD||ABAVKAUFPOS AS ABAVKAUF,EKKEINSTA,EKKLIEFNR,EKKAUFKRS,EKKAUFLFD, EKKSACHB, "
                + " utl_raw.cast_to_varchar2(EKPART) AS PART,utl_raw.cast_to_varchar2(EKPVAR) AS PVAR,utl_raw.cast_to_varchar2(EKPFARBE) AS PFARBE, P.*,  "
                + " (SELECT MAX(TRIM(S.KDKUNDNA)) FROM VKKOPF K,KDSTAMM S WHERE K.VKKMANDANT = S.KDMANDANT AND K.VKKKUNDNR = S.KDKUNDNR AND K.VKKAUFKRS = ABAVKAUFKRS "
                + "  AND K.VKKAUFLFD =ABAVKAUFLFD ) AS CUSTOMER "
                + " FROM EKPOS P JOIN EKKOPF ON EKPMANDANT=EKKMANDANT AND EKPAUFKRS=EKKAUFKRS AND EKPAUFLFD=EKKAUFLFD "
                + " LEFT JOIN ABAUFM ON ABAMANDANT=EKPMANDANT AND ABAAUFKRS=EKPAUFKRS AND ABAAUFLFD=EKPAUFLFD AND ABAAUFPOS=EKPAUFPOS AND ABAAPOS='0002' "
                + " JOIN LIEFDAT ON LSLIEFNR=EKPLIEFNR "
                + " WHERE EKPSA='PO' AND EKPGESSTA='  '  AND EKPMANDANT=:EKPMANDANT: "
                + dwData["EKPAUFKRS"].ToString()
                + " order by ekpaufkrs,ekpauflfd,ekpaufpos ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }

        public void InsertEKPOS(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            dwData["EKPNEUB"] = app.User;
            dwData["EKPNEUD"] = date;
            or1 = OracleDB.CreateCommand();
            switch (app.company)
            {

                case "YCA":
                    or1.CommandText = "INSERT INTO EKPOS(EKPSA, EKPMANDANT, EKPAUFKRS, EKPAUFLFD, EKPAUFPOS, EKPAENDST, EKPAENZL, EKPAENB, EKPAEND, EKPNEUB, EKPNEUD, EKPAUFGRP, EKPAUFART, EKPARTGR, EKPKUNDNR, EKPWERK, EKPABT, EKPWAKZ, EKPART, EKPVAR, EKPFARBE, EKPDESS, EKPCOL, EKPBESCH, EKPZUSTAND, EKPGROE, EKPSCHLIGR, EKPSCHLINR, EKPLSART, EKPLSVAR, EKPLSFB, EKPLSDESS, EKPLSCOL, EKPLSBE, EKPLSZUSTAND, EKPLSGROE, EKPLSGRPBEZ, EKPLSARTBEZ, EKPSTKLGV, EKPSTKLGB, EKPPRKZ, EKPPRUEF, EKPMATKOMPDR, EKPPARTIE, EKPSPUL, EKPSPULG, EKPSPULM, EKPVPEINH, EKPAM, EKPZUSAM, EKPHUELSE, EKPKF, EKPFDRES, EKPWI, EKPANZTKB, EKPLOSGR, EKPWIRKGEW, EKPVKUNDNR, EKPVWERK, EKPVABT, EKPVART, EKPVVAR, EKPVFARBE, EKPEKUNDNR, EKPEWERK, EKPEABT, EKPEART, EKPEVAR, EKPEFARBE, EKPEDESS, EKPECOL, EKPEBESCH, EKPEZUSTAND, EKPEGROE, EKPMINLIME, EKPMINLISP, EKPMEEH, EKPMEEHGRP, EKPMEEHFKT, EKPME1, EKPME2, EKPME3, EKPME4, EKPME5, EKPME6, EKPME7, EKPME8, EKPME9, EKPMEO, EKPMEU, EKPSMENGE, EKPWE1, EKPWE2, EKPWE3, EKPWE4, EKPWE5, EKPWE6, EKPWE7, EKPWE8, EKPWE9, EKPBDAT, EKPLTERM, EKPFIX, EKPLDAT, EKPDRUDAT, EKPWVTERM, EKPWUTERM, EKPVEINDAT, EKPVEINDALT, EKPLTERMBE, EKPLTERMKZ, EKPVTERMIN, EKPVTERMEIN, EKPDATVON, EKPBEDAT, EKPTERMTAB, EKPTERMIND, EKPSOLLDAT1, EKPISTDAT1, EKPSOLLDAT2, EKPISTDAT2, EKPSOLLDAT3, EKPISTDAT3, EKPSOLLDAT4, EKPISTDAT4, EKPSOLLDAT5, EKPISTDAT5, EKPSOLLDAT6, EKPISTDAT6, EKPLRUECK, EKPPRME, EKPPREH, EKPPREHGRP, EKPPREHFKT, EKPPRDR, EKPPREISKZ, EKPPREISLST, EKPRABATTKZ, EKPRABATT, EKPRABART1, EKPRABPROZ1, EKPRABWERT1, EKPRABART2, EKPRABPROZ2, EKPRABWERT2, EKPRABART3, EKPRABPROZ3, EKPRABWERT3, EKPRABART4, EKPRABPROZ4, EKPRABWERT4, EKPRABART5, EKPRABPROZ5, EKPRABWERT5, EKPZUAB1, EKPZUABPR1, EKPZUABWE1, EKPZUABME1, EKPABRKZ1, EKPZUAB2, EKPZUABPR2, EKPZUABWE2, EKPZUABME2, EKPABRKZ2, EKPZUAB3, EKPZUABPR3, EKPZUABWE3, EKPZUABME3, EKPABRKZ3, EKPZUAB4, EKPZUABPR4, EKPZUABWE4, EKPZUABME4, EKPABRKZ4, EKPZUAB5, EKPZUABPR5, EKPZUABWE5, EKPZUABME5, EKPABRKZ5, EKPZUABWERT, EKPFIXBONP, EKPFIXBONA, EKPKALBONP, EKPKALBONA, EKPCOUPON, EKPKOKRS, EKPKOLFD, EKPKOPOS, EKPSTA, EKPSTAKZ, EKPMAHNKZ, EKPMAHNKZA, EKPMAHNDAT, EKPKTOKL4, EKPKSTKRS, EKPKST, EKPBUDGET, EKPINVAUF, EKPFAUFTYP, EKPFAUFKRS, EKPFAUFLFD, EKPFAUFPOS, EKPANRKR, EKPALFDNR, EKPWAEHRSL, EKPKURS, EKPBETRAG, EKPHWAEHRSL, EKPHEUROKURS, EKPHEUROKURSVK, EKPFEUROKURS, EKPFEUROKURSVK, EKPTERMNR, EKPFAELLIG, EKPSICHER, EKPSICHP, EKPAKKRED, EKPUDATUM, EKPUAENZL, EKPUAENB, EKPLIEFNR, EKPKONDSL, EKPLO, EKPLB, EKPLPLATZ, EKPLIEFERSCH, EKPZOLLSL, EKPIMEXSL, EKPKNTRNRL, EKPLIEFKOMP, EKPABRUF, EKPSACHB, EKPLEBKZ, EKPSPERR, EKPWIEBEST, EKPBEKZ, EKPPOSTYP, EKPGESSTA, EKPEINSTA, EKPZENSUR, EKPTEXTKON, EKPMCODE, EKPGENBENID1, EKPGENDAT1, EKPGENBENID2, EKPGENDAT2, EKPGENBENID3, EKPGENDAT3, EKPGENSTUFE, EKPGENOFFEN, EKPABLADEST, EKPVERBENID, EKPWEMAIL, EKPURLAND, EKPETIDR, EKPCHAR, EKPGNR, EKPZUARTF, EKPZUABPRF, EKPZUABWEF, EKPMEEHF, EKPABRKZF, EKPZUARTV, EKPZUABPRV, EKPZUABWEV, EKPMEEHV, EKPABRKZV, EKPVERSICH, EKPEDIKZ, EKPKOMMNR, EKPKOMMPOS, EKPEDIDAT, EKPEDIZEIT, EKPURBESTPOS, EKPVERTRNRK, EKPVERTRPOSK, EKPTERMSTA, EKPKONTSTA, EKPZUABSTA, EKPEXMANDANT, EKPWVTERMVG, EKPFILLER14)"
                    + " VALUES ('PO', :EKPMANDANT, :EKPAUFKRS, :EKPAUFLFD, :EKPAUFPOS, '000', 1, 'INTEXE  ', 20130808, 'INTEXE  ', 20130808, 'B', 'BE', '8', '        ', '   ', '   ', ' ', '3030303030303030303030303031202020202020', '303030', '20202020202020202020', '          ', '          ', '          ', '    ', '       ', '     ', '000000000000000', '                    ', '   ', '          ', '          ', '          ', '          ', '    ', '       ', '                    ', '                ', 0, 0, ' ', '    ', 'J', '       ', 0, 0, 0, '    ', '  ', '  ', '      ', ' ', ' ', ' ', 0, 0, 0, '        ', '   ', '   ', '2020202020202020202020202020202020202020', '202020', '20202020202020202020', '        ', '   ', '   ', '                    ', '   ', '          ', '          ', '          ', '          ', '    ', '       ', 0, 0, 'KG ', '4', '000001000000', 123400, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1234000, 0, 0, 0, 0, 0, 0, 0, 0, 20081111, 20130808, ' ', '08.08.13', 0, 20130920, 20130808, 20130927, 20130808, 0, ' ', 0, '        ', 0, 0, 'POS ', 0, 20130920, 0, 20130927, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '0000010000', 'KG ', '4', '000001000000', 'J', 'N.', '     ', ' ', 0, '   ', 0, 0, '   ', 0, 0, '   ', 0, 0, '   ', 0, 0, '   ', 0, 0, '   ', 0, 0, '   ', ' ', '   ', 0, 0, '   ', ' ', '   ', 0, 0, '   ', ' ', '   ', 0, 0, '   ', ' ', '   ', 0, 0, '   ', ' ', 0, 0, 0, 0, 0, ' ', '  ', '      ', '   ', '  ', 'I', '  ', '  ', 0, '000000', '  ', '0000', '        ', '00000000', ' ', '  ', '000000', '000', '  ', '000000', 'RMB', 10000, 1, 'RMB', 0, ' ', 0, ' ', 0, 0, '0', 0, '               ', 0, 0, '        ', '00009003', 'STD ', '01', '  ', '        ', '        ', ' ', ' ', '               ', ' ', ' ', 'JANE    ', ' ', ' ', '        ', ' ', '   ', '  ', '10', ' ', '              ', '              ', '        ', 0, '        ', 0, '        ', 0, 0, '        ', '    ', '        ', ' ', '   ', ' ', 0, 0, '   ', 0, 0, '   ', ' ', '   ', 0, 0, '   ', ' ', 0, ' ', '                    ', '0000', 0, 0, '000', '                    ', '0000', '20', '30', '40', '  ', ' ', '00000000               00000000 00000000       000000000                ')";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
                    or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = dwData["EKPAUFPOS"].ToString();
                    break;
                default:
                case "TST":
                case "YGR":
                    or1.CommandText = "INSERT INTO EKPOS ( EKPSA,EKPMANDANT,EKPAUFKRS,EKPAUFLFD,EKPAUFPOS,EKPAENDST,EKPAENZL,EKPAENB,EKPAEND,EKPNEUB,EKPNEUD,EKPAUFGRP,EKPAUFART,EKPARTGR,EKPKUNDNR,EKPWERK,EKPABT,EKPWAKZ,EKPART,EKPVAR,EKPFARBE,EKPDESS,EKPCOL,EKPBESCH,EKPZUSTAND,EKPGROE,EKPSCHLIGR,EKPSCHLINR,EKPLSART,EKPLSVAR,EKPLSFB,EKPLSDESS,EKPLSCOL,EKPLSBE,EKPLSZUSTAND,EKPLSGROE,EKPLSGRPBEZ,EKPLSART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F,EKPZUARTV,EKPZUABPRV,EKPZUABWEV,EKPMEEHV,EKPABRKZV,EKPVERSICH,EKPEDIKZ,EKPKOMMNR,EKPKOMMPOS,EKPEDIDAT,EKPEDIZEIT,EKPURBESTPOS,EKPVERTRNRK,EKPVERTRPOSK,EKPTERMSTA,EKPKONTSTA,EKPZUABSTA,EKPEXMANDANT,EKPWVTERMVG,EKPFILLER14)"
                     + " VALUES (:EKPSA:,:EKPMANDANT:,:EKPAUFKRS:,:EKPAUFLFD:,:EKPAUFPOS:,:EKPAENDST:,:EKPAENZL:,:EKPAENB:,:EKPAEND:,:EKPNEUB:,:EKPNEUD:,:EKPAUFGRP:,:EKPAUFART:,:EKPARTGR:,:EKPKUNDNR:,:EKPWERK:,:EKPABT:,:EKPWAKZ:,utl_raw.cast_to_raw(:PART:),utl_raw.cast_to_raw(:PVAR:),utl_raw.cast_to_raw(:PFARBE:),:EKPDESS:,:EKPCOL:,:EKPBESCH:,:EKPZUSTAND:,:EKPGROE:,:EKPSCHLIGR:,:EKPSCHLINR:,:EKPLSART:,:EKPLSVAR:,:EKPLSFB:,:EKPLSDESS:,:EKPLSCOL:,:EKPLSBE:,:EKPLSZUSTAND:,:EKPLSGROE:,:EKPLSGRPBEZ:,:EKPLSARTBEZ:,:EKPSTKLGV:,:EKPSTKLGB:,:EKPPRKZ:,:EKPPRUEF:,:EKPMATKOMPDR:,:EKPPARTIE:,:EKPSPUL:,:EKPSPULG:,:EKPSPULM:,:EKPVPEINH:,:EKPAM:,:EKPZUSAM:,:EKPHUELSE:,:EKPKF:,:EKPFDRES:,:EKPWI:,:EKPANZTKB:,:EKPLOSGR:,:EKPWIRKGEW:,:EKPVKUNDNR:,:EKPVWERK:,:EKPVABT:,utl_raw.cast_to_raw(:PART:),utl_raw.cast_to_raw(:PVAR:),utl_raw.cast_to_raw(:PFARBE:),:EKPEKUNDNR:,:EKPEWERK:,:EKPEABT:,:EKPEART:,:EKPEVAR:,:EKPEFARBE:,:EKPEDESS:,:EK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EKPWEMAIL:,:EKPURLAND:,:EKPETIDR:,:EKPCHAR:,:EKPGNR:,:EKPZUARTF:,:EKPZUABPRF:,:EKPZUABWEF:,:EKPMEEHF:,:EKPABRKZF:,:EKPZUARTV:,:EKPZUABPRV:,:EKPZUABWEV:,:EKPMEEHV:,:EKPABRKZV:,:EKPVERSICH:,:EKPEDIKZ:,:EKPKOMMNR:,:EKPKOMMPOS:,:EKPEDIDAT:,:EKPEDIZEIT:,:EKPURBESTPOS:,:EKPVERTRNRK:,:EKPVERTRPOSK:,:EKPTERMSTA:,:EKPKONTSTA:,:EKPZUABSTA:,:EKPEXMANDANT:,:EKPWVTERMVG:,:EKPFILLER14:)";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
            }
            Connect2Proxy(or1);
        }
        public void DeleteEKPOS(string client, string krs, string lfd, string pos)
        {

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE EKPOS "
            + " WHERE EKPMANDANT=:EKPMANDANT   AND EKPAUFKRS=:EKPAUFKRS  AND EKPAUFLFD=:EKPAUFLFD AND EKPAUFPOS=:EKPAUFPOS";
            or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = krs;
            or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = lfd;
            or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = pos;
            Connect2Proxy(or1);
        }
        public void DeleteEKPOS(DataRow dwData, int option = 1)
        {

            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "DELETE EKPOS  WHERE EKPMANDANT=:EKPMANDANT:   AND EKPAUFKRS=:EKPAUFKRS:  ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 1:
                    or1.CommandText = "DELETE EKPOS  WHERE EKPMANDANT=:EKPMANDANT:   AND EKPAUFKRS=:EKPAUFKRS:  AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 2:
                    or1.CommandText = "DELETE EKPOS  WHERE EKPMANDANT=:EKPMANDANT:   AND EKPAUFKRS=:EKPAUFKRS:  AND EKPAUFLFD=:EKPAUFLFD: AND  EKPME1=0";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
            }

            Connect2Proxy(or1);
        }
        public void UpdateEKPOS(DataRow dwData, int option = 1)
        {
            if (option == 0)
            {
                switch (app.company)
                {
                    default:
                        option = 10;
                        break;
                    case "YCA":
                        option = 1;
                        break;
                }
            }
            if (dwData != null)
            {
                dwData["EKPAENB"] = app.User;
                dwData["EKPAEND"] = date;
            }

            switch (option)
            {
                case 1: UEKP01(dwData); break;
                case 2: UEKP02(dwData); break;
                case 21: UEKP21(dwData); break;
                case 3: UEKP03(dwData); break;
                case 4: UEKP04(dwData); break;
                case 5: UEKP05(dwData); break;
                case 6: UEKP06(dwData); break;
                case 9: UEKP09(dwData); break;
                case 10: UEKP10(dwData); break;
                case 11: UEKP11(dwData); break;
                case 12: UEKP12(dwData); break;
                case 13: UEKP13(dwData); break;
                case 14: UEKP14(dwData); break;
                case 20: UEKP20(dwData); break;
                default:
                    break;
            }

        }
        public void UEKP01(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            #region============Command==============
            or1.CommandText = "UPDATE EKPOS SET "
                + "EKPSA=:EKPSA,"
                + "EKPMANDANT=:EKPMANDANT,"
                + "EKPAUFKRS=:EKPAUFKRS,"
                + "EKPAUFLFD=:EKPAUFLFD,"
                + "EKPAUFPOS=:EKPAUFPOS,"
                + "EKPAENDST=:EKPAENDST,"
                + "EKPAENZL=:EKPAENZL,"
                + "EKPAENB=:EKPAENB,"
                + "EKPAEND=:EKPAEND,"
                + "EKPNEUB=:EKPNEUB,"
                + "EKPNEUD=:EKPNEUD,"
                + "EKPAUFGRP=:EKPAUFGRP,"
                + "EKPAUFART=:EKPAUFART,"
                + "EKPARTGR=:EKPARTGR,"
                + "EKPKUNDNR=:EKPKUNDNR,"
                + "EKPWERK=:EKPWERK,"
                + "EKPABT=:EKPABT,"
                + "EKPWAKZ=:EKPWAKZ,"
                + "EKPART=utl_raw.cast_to_raw(:EKPART),"
                + "EKPVAR=utl_raw.cast_to_raw(:EKPVAR),"
                + "EKPFARBE=utl_raw.cast_to_raw(:EKPFARBE),"
                + "EKPDESS=:EKPDESS,"
                + "EKPCOL=:EKPCOL,"
                + "EKPBESCH=:EKPBESCH,"
                + "EKPZUSTAND=:EKPZUSTAND,"
                + "EKPGROE=:EKPGROE,"
                + "EKPSCHLIGR=:EKPSCHLIGR,"
                + "EKPSCHLINR=:EKPSCHLINR,"
                + "EKPLSART=:EKPLSART,"
                + "EKPLSVAR=:EKPLSVAR,"
                + "EKPLSFB=:EKPLSFB,"
                + "EKPLSDESS=:EKPLSDESS,"
                + "EKPLSCOL=:EKPLSCOL,"
                + "EKPLSBE=:EKPLSBE,"
                + "EKPLSZUSTAND=:EKPLSZUSTAND,"
                + "EKPLSGROE=:EKPLSGROE,"
                + "EKPLSGRPBEZ=:EKPLSGRPBEZ,"
                + "EKPLSARTBEZ=:EKPLSARTBEZ,"
                + "EKPSTKLGV=:EKPSTKLGV,"
                + "EKPSTKLGB=:EKPSTKLGB,"
                + "EKPPRKZ=:EKPPRKZ,"
                + "EKPPRUEF=:EKPPRUEF,"
                + "EKPMATKOMPDR=:EKPMATKOMPDR,"
                + "EKPPARTIE=:EKPPARTIE,"
                + "EKPSPUL=:EKPSPUL,"
                + "EKPSPULG=:EKPSPULG,"
                + "EKPSPULM=:EKPSPULM,"
                + "EKPVPEINH=:EKPVPEINH,"
                + "EKPAM=:EKPAM,"
                + "EKPZUSAM=:EKPZUSAM,"
                + "EKPHUELSE=:EKPHUELSE,"
                + "EKPKF=:EKPKF,"
                + "EKPFDRES=:EKPFDRES,"
                + "EKPWI=:EKPWI,"
                + "EKPANZTKB=:EKPANZTKB,"
                + "EKPLOSGR=:EKPLOSGR,"
                + "EKPWIRKGEW=:EKPWIRKGEW,"
                + "EKPVKUNDNR=:EKPVKUNDNR,"
                + "EKPVWERK=:EKPVWERK,"
                + "EKPVABT=:EKPVABT,"
                + "EKPVART=utl_raw.cast_to_raw(:EKPVART),"
                + "EKPVVAR=utl_raw.cast_to_raw(:EKPVVAR),"
                + "EKPVFARBE=utl_raw.cast_to_raw(:EKPVFARBE),"
                + "EKPEKUNDNR=:EKPEKUNDNR,"
                + "EKPEWERK=:EKPEWERK,"
                + "EKPEABT=:EKPEABT,"
                + "EKPEART=:EKPEART,"
                + "EKPEVAR=:EKPEVAR,"
                + "EKPEFARBE=:EKPEFARBE,"
                + "EKPEDESS=:EKPEDESS,"
                + "EKPECOL=:EKPECOL,"
                + "EKPEBESCH=:EKPEBESCH,"
                + "EKPEZUSTAND=:EKPEZUSTAND,"
                + "EKPEGROE=:EKPEGROE,"
                + "EKPMINLIME=:EKPMINLIME,"
                + "EKPMINLISP=:EKPMINLISP,"
                + "EKPMEEH=:EKPMEEH,"
                + "EKPMEEHGRP=:EKPMEEHGRP,"
                + "EKPMEEHFKT=:EKPMEEHFKT,"
                + "EKPME1=:EKPME1,"
                + "EKPME2=:EKPME2,"
                + "EKPME3=:EKPME3,"
                + "EKPME4=:EKPME4,"
                + "EKPME5=:EKPME5,"
                + "EKPME6=:EKPME6,"
                + "EKPME7=:EKPME7,"
                + "EKPME8=:EKPME8,"
                + "EKPME9=:EKPME9,"
                + "EKPMEO=:EKPMEO,"
                + "EKPMEU=:EKPMEU,"
                + "EKPSMENGE=:EKPSMENGE,"
                + "EKPWE1=:EKPWE1,"
                + "EKPWE2=:EKPWE2,"
                + "EKPWE3=:EKPWE3,"
                + "EKPWE4=:EKPWE4,"
                + "EKPWE5=:EKPWE5,"
                + "EKPWE6=:EKPWE6,"
                + "EKPWE7=:EKPWE7,"
                + "EKPWE8=:EKPWE8,"
                + "EKPWE9=:EKPWE9,"
                + "EKPBDAT=:EKPBDAT,"
                + "EKPLTERM=:EKPLTERM,"
                + "EKPFIX=:EKPFIX,"
                + "EKPLDAT=:EKPLDAT,"
                + "EKPDRUDAT=:EKPDRUDAT,"
                + "EKPWVTERM=:EKPWVTERM,"
                + "EKPWUTERM=:EKPWUTERM,"
                + "EKPVEINDAT=:EKPVEINDAT,"
                + "EKPVEINDALT=:EKPVEINDALT,"
                + "EKPLTERMBE=:EKPLTERMBE,"
                + "EKPLTERMKZ=:EKPLTERMKZ,"
                + "EKPVTERMIN=:EKPVTERMIN,"
                + "EKPVTERMEIN=:EKPVTERMEIN,"
                + "EKPDATVON=:EKPDATVON,"
                + "EKPBEDAT=:EKPBEDAT,"
                + "EKPTERMTAB=:EKPTERMTAB,"
                + "EKPTERMIND=:EKPTERMIND,"
                + "EKPSOLLDAT1=:EKPSOLLDAT1,"
                + "EKPISTDAT1=:EKPISTDAT1,"
                + "EKPSOLLDAT2=:EKPSOLLDAT2,"
                + "EKPISTDAT2=:EKPISTDAT2,"
                + "EKPSOLLDAT3=:EKPSOLLDAT3,"
                + "EKPISTDAT3=:EKPISTDAT3,"
                + "EKPSOLLDAT4=:EKPSOLLDAT4,"
                + "EKPISTDAT4=:EKPISTDAT4,"
                + "EKPSOLLDAT5=:EKPSOLLDAT5,"
                + "EKPISTDAT5=:EKPISTDAT5,"
                + "EKPSOLLDAT6=:EKPSOLLDAT6,"
                + "EKPISTDAT6=:EKPISTDAT6,"
                + "EKPLRUECK=:EKPLRUECK,"
                + "EKPPRME=:EKPPRME,"
                + "EKPPREH=:EKPPREH,"
                + "EKPPREHGRP=:EKPPREHGRP,"
                + "EKPPREHFKT=:EKPPREHFKT,"
                + "EKPPRDR=:EKPPRDR,"
                + "EKPPREISKZ=:EKPPREISKZ,"
                + "EKPPREISLST=:EKPPREISLST,"
                + "EKPRABATTKZ=:EKPRABATTKZ,"
                + "EKPRABATT=:EKPRABATT,"
                + "EKPRABART1=:EKPRABART1,"
                + "EKPRABPROZ1=:EKPRABPROZ1,"
                + "EKPRABWERT1=:EKPRABWERT1,"
                + "EKPRABART2=:EKPRABART2,"
                + "EKPRABPROZ2=:EKPRABPROZ2,"
                + "EKPRABWERT2=:EKPRABWERT2,"
                + "EKPRABART3=:EKPRABART3,"
                + "EKPRABPROZ3=:EKPRABPROZ3,"
                + "EKPRABWERT3=:EKPRABWERT3,"
                + "EKPRABART4=:EKPRABART4,"
                + "EKPRABPROZ4=:EKPRABPROZ4,"
                + "EKPRABWERT4=:EKPRABWERT4,"
                + "EKPRABART5=:EKPRABART5,"
                + "EKPRABPROZ5=:EKPRABPROZ5,"
                + "EKPRABWERT5=:EKPRABWERT5,"
                + "EKPZUAB1=:EKPZUAB1,"
                + "EKPZUABPR1=:EKPZUABPR1,"
                + "EKPZUABWE1=:EKPZUABWE1,"
                + "EKPZUABME1=:EKPZUABME1,"
                + "EKPABRKZ1=:EKPABRKZ1,"
                + "EKPZUAB2=:EKPZUAB2,"
                + "EKPZUABPR2=:EKPZUABPR2,"
                + "EKPZUABWE2=:EKPZUABWE2,"
                + "EKPZUABME2=:EKPZUABME2,"
                + "EKPABRKZ2=:EKPABRKZ2,"
                + "EKPZUAB3=:EKPZUAB3,"
                + "EKPZUABPR3=:EKPZUABPR3,"
                + "EKPZUABWE3=:EKPZUABWE3,"
                + "EKPZUABME3=:EKPZUABME3,"
                + "EKPABRKZ3=:EKPABRKZ3,"
                + "EKPZUAB4=:EKPZUAB4,"
                + "EKPZUABPR4=:EKPZUABPR4,"
                + "EKPZUABWE4=:EKPZUABWE4,"
                + "EKPZUABME4=:EKPZUABME4,"
                + "EKPABRKZ4=:EKPABRKZ4,"
                + "EKPZUAB5=:EKPZUAB5,"
                + "EKPZUABPR5=:EKPZUABPR5,"
                + "EKPZUABWE5=:EKPZUABWE5,"
                + "EKPZUABME5=:EKPZUABME5,"
                + "EKPABRKZ5=:EKPABRKZ5,"
                + "EKPZUABWERT=:EKPZUABWERT,"
                + "EKPFIXBONP=:EKPFIXBONP,"
                + "EKPFIXBONA=:EKPFIXBONA,"
                + "EKPKALBONP=:EKPKALBONP,"
                + "EKPKALBONA=:EKPKALBONA,"
                + "EKPCOUPON=:EKPCOUPON,"
                + "EKPKOKRS=:EKPKOKRS,"
                + "EKPKOLFD=:EKPKOLFD,"
                + "EKPKOPOS=:EKPKOPOS,"
                + "EKPSTA=:EKPSTA,"
                + "EKPSTAKZ=:EKPSTAKZ,"
                + "EKPMAHNKZ=:EKPMAHNKZ,"
                + "EKPMAHNKZA=:EKPMAHNKZA,"
                + "EKPMAHNDAT=:EKPMAHNDAT,"
                + "EKPKTOKL4=:EKPKTOKL4,"
                + "EKPKSTKRS=:EKPKSTKRS,"
                + "EKPKST=:EKPKST,"
                + "EKPBUDGET=:EKPBUDGET,"
                + "EKPINVAUF=:EKPINVAUF,"
                + "EKPFAUFTYP=:EKPFAUFTYP,"
                + "EKPFAUFKRS=:EKPFAUFKRS,"
                + "EKPFAUFLFD=:EKPFAUFLFD,"
                + "EKPFAUFPOS=:EKPFAUFPOS,"
                + "EKPANRKR=:EKPANRKR,"
                + "EKPALFDNR=:EKPALFDNR,"
                + "EKPWAEHRSL=:EKPWAEHRSL,"
                + "EKPKURS=:EKPKURS,"
                + "EKPBETRAG=:EKPBETRAG,"
                + "EKPHWAEHRSL=:EKPHWAEHRSL,"
                + "EKPHEUROKURS=:EKPHEUROKURS,"
                + "EKPHEUROKURSVK=:EKPHEUROKURSVK,"
                + "EKPFEUROKURS=:EKPFEUROKURS,"
                + "EKPFEUROKURSVK=:EKPFEUROKURSVK,"
                + "EKPTERMNR=:EKPTERMNR,"
                + "EKPFAELLIG=:EKPFAELLIG,"
                + "EKPSICHER=:EKPSICHER,"
                + "EKPSICHP=:EKPSICHP,"
                + "EKPAKKRED=:EKPAKKRED,"
                + "EKPUDATUM=:EKPUDATUM,"
                + "EKPUAENZL=:EKPUAENZL,"
                + "EKPUAENB=:EKPUAENB,"
                + "EKPLIEFNR=:EKPLIEFNR,"
                + "EKPKONDSL=:EKPKONDSL,"
                + "EKPLO=:EKPLO,"
                + "EKPLB=:EKPLB,"
                + "EKPLPLATZ=:EKPLPLATZ,"
                + "EKPLIEFERSCH=:EKPLIEFERSCH,"
                + "EKPZOLLSL=:EKPZOLLSL,"
                + "EKPIMEXSL=:EKPIMEXSL,"
                + "EKPKNTRNRL=:EKPKNTRNRL,"
                + "EKPLIEFKOMP=:EKPLIEFKOMP,"
                + "EKPABRUF=:EKPABRUF,"
                + "EKPSACHB=:EKPSACHB,"
                + "EKPLEBKZ=:EKPLEBKZ,"
                + "EKPSPERR=:EKPSPERR,"
                + "EKPWIEBEST=:EKPWIEBEST,"
                + "EKPBEKZ=:EKPBEKZ,"
                + "EKPPOSTYP=:EKPPOSTYP,"
                + "EKPGESSTA=:EKPGESSTA,"
                + "EKPEINSTA=:EKPEINSTA,"
                + "EKPZENSUR=:EKPZENSUR,"
                + "EKPTEXTKON=:EKPTEXTKON,"
                + "EKPMCODE=:EKPMCODE,"
                + "EKPGENBENID1=:EKPGENBENID1,"
                + "EKPGENDAT1=:EKPGENDAT1,"
                + "EKPGENBENID2=:EKPGENBENID2,"
                + "EKPGENDAT2=:EKPGENDAT2,"
                + "EKPGENBENID3=:EKPGENBENID3,"
                + "EKPGENDAT3=:EKPGENDAT3,"
                + "EKPGENSTUFE=:EKPGENSTUFE,"
                + "EKPGENOFFEN=:EKPGENOFFEN,"
                + "EKPABLADEST=:EKPABLADEST,"
                + "EKPVERBENID=:EKPVERBENID,"
                + "EKPWEMAIL=:EKPWEMAIL,"
                + "EKPURLAND=:EKPURLAND,"
                + "EKPETIDR=:EKPETIDR,"
                + "EKPCHAR=:EKPCHAR,"
                + "EKPGNR=:EKPGNR,"
                + "EKPZUARTF=:EKPZUARTF,"
                + "EKPZUABPRF=:EKPZUABPRF,"
                + "EKPZUABWEF=:EKPZUABWEF,"
                + "EKPMEEHF=:EKPMEEHF,"
                + "EKPABRKZF=:EKPABRKZF,"
                + "EKPZUARTV=:EKPZUARTV,"
                + "EKPZUABPRV=:EKPZUABPRV,"
                + "EKPZUABWEV=:EKPZUABWEV,"
                + "EKPMEEHV=:EKPMEEHV,"
                + "EKPABRKZV=:EKPABRKZV,"
                + "EKPVERSICH=:EKPVERSICH,"
                + "EKPEDIKZ=:EKPEDIKZ,"
                + "EKPKOMMNR=:EKPKOMMNR,"
                + "EKPKOMMPOS=:EKPKOMMPOS,"
                + "EKPEDIDAT=:EKPEDIDAT,"
                + "EKPEDIZEIT=:EKPEDIZEIT,"
                + "EKPURBESTPOS=:EKPURBESTPOS,"
                + "EKPVERTRNRK=:EKPVERTRNRK,"
                + "EKPVERTRPOSK=:EKPVERTRPOSK,"
                + "EKPTERMSTA=:EKPTERMSTA,"
                + "EKPKONTSTA=:EKPKONTSTA,"
                + "EKPZUABSTA=:EKPZUABSTA,"
                + "EKPEXMANDANT=:EKPEXMANDANT,"
                + "EKPWVTERMVG=:EKPWVTERMVG,"
                + "EKPFILLER14=:EKPFILLER14 "
            + " WHERE  "
            + "  EKPMANDANT=:EKPMANDANT AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD AND EKPAUFPOS=:EKPAUFPOS";
            #endregion
            #region============Parameters==============
            or1.Parameters.Add("EKPSA", OracleType.NVarChar).Value = dwData["EKPSA"].ToString();
            or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = dwData["EKPMANDANT"].ToString();
            or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = dwData["EKPAUFKRS"].ToString();
            or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = dwData["EKPAUFLFD"].ToString();
            or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = dwData["EKPAUFPOS"].ToString();
            or1.Parameters.Add("EKPAENDST", OracleType.NVarChar).Value = dwData["EKPAENDST"].ToString();
            or1.Parameters.Add("EKPAENZL", OracleType.NVarChar).Value = dwData["EKPAENZL"].ToString();
            or1.Parameters.Add("EKPAENB", OracleType.NVarChar).Value = dwData["EKPAENB"].ToString();
            or1.Parameters.Add("EKPAEND", OracleType.NVarChar).Value = dwData["EKPAEND"].ToString();
            or1.Parameters.Add("EKPNEUB", OracleType.NVarChar).Value = dwData["EKPNEUB"].ToString();
            or1.Parameters.Add("EKPNEUD", OracleType.NVarChar).Value = dwData["EKPNEUD"].ToString();
            or1.Parameters.Add("EKPAUFGRP", OracleType.NVarChar).Value = dwData["EKPAUFGRP"].ToString();
            or1.Parameters.Add("EKPAUFART", OracleType.NVarChar).Value = dwData["EKPAUFART"].ToString();
            or1.Parameters.Add("EKPARTGR", OracleType.NVarChar).Value = dwData["EKPARTGR"].ToString();
            or1.Parameters.Add("EKPKUNDNR", OracleType.NVarChar).Value = dwData["EKPKUNDNR"].ToString();
            or1.Parameters.Add("EKPWERK", OracleType.NVarChar).Value = dwData["EKPWERK"].ToString();
            or1.Parameters.Add("EKPABT", OracleType.NVarChar).Value = dwData["EKPABT"].ToString();
            or1.Parameters.Add("EKPWAKZ", OracleType.NVarChar).Value = dwData["EKPWAKZ"].ToString();
            or1.Parameters.Add("EKPART", OracleType.NVarChar).Value = dwData["EKPART"].ToString();
            or1.Parameters.Add("EKPVAR", OracleType.NVarChar).Value = dwData["EKPVAR"].ToString();
            or1.Parameters.Add("EKPFARBE", OracleType.NVarChar).Value = dwData["EKPFARBE"].ToString();
            or1.Parameters.Add("EKPDESS", OracleType.NVarChar).Value = dwData["EKPDESS"].ToString();
            or1.Parameters.Add("EKPCOL", OracleType.NVarChar).Value = dwData["EKPCOL"].ToString();
            or1.Parameters.Add("EKPBESCH", OracleType.NVarChar).Value = dwData["EKPBESCH"].ToString();
            or1.Parameters.Add("EKPZUSTAND", OracleType.NVarChar).Value = dwData["EKPZUSTAND"].ToString();
            or1.Parameters.Add("EKPGROE", OracleType.NVarChar).Value = dwData["EKPGROE"].ToString();
            or1.Parameters.Add("EKPSCHLIGR", OracleType.NVarChar).Value = dwData["EKPSCHLIGR"].ToString();
            or1.Parameters.Add("EKPSCHLINR", OracleType.NVarChar).Value = dwData["EKPSCHLINR"].ToString();
            or1.Parameters.Add("EKPLSART", OracleType.NVarChar).Value = dwData["EKPLSART"].ToString();
            or1.Parameters.Add("EKPLSVAR", OracleType.NVarChar).Value = dwData["EKPLSVAR"].ToString();
            or1.Parameters.Add("EKPLSFB", OracleType.NVarChar).Value = dwData["EKPLSFB"].ToString();
            or1.Parameters.Add("EKPLSDESS", OracleType.NVarChar).Value = dwData["EKPLSDESS"].ToString();
            or1.Parameters.Add("EKPLSCOL", OracleType.NVarChar).Value = dwData["EKPLSCOL"].ToString();
            or1.Parameters.Add("EKPLSBE", OracleType.NVarChar).Value = dwData["EKPLSBE"].ToString();
            or1.Parameters.Add("EKPLSZUSTAND", OracleType.NVarChar).Value = dwData["EKPLSZUSTAND"].ToString();
            or1.Parameters.Add("EKPLSGROE", OracleType.NVarChar).Value = dwData["EKPLSGROE"].ToString();
            or1.Parameters.Add("EKPLSGRPBEZ", OracleType.NVarChar).Value = dwData["EKPLSGRPBEZ"].ToString();
            or1.Parameters.Add("EKPLSARTBEZ", OracleType.NVarChar).Value = dwData["EKPLSARTBEZ"].ToString();
            or1.Parameters.Add("EKPSTKLGV", OracleType.NVarChar).Value = dwData["EKPSTKLGV"].ToString();
            or1.Parameters.Add("EKPSTKLGB", OracleType.NVarChar).Value = dwData["EKPSTKLGB"].ToString();
            or1.Parameters.Add("EKPPRKZ", OracleType.NVarChar).Value = dwData["EKPPRKZ"].ToString();
            or1.Parameters.Add("EKPPRUEF", OracleType.NVarChar).Value = dwData["EKPPRUEF"].ToString();
            or1.Parameters.Add("EKPMATKOMPDR", OracleType.NVarChar).Value = dwData["EKPMATKOMPDR"].ToString();
            or1.Parameters.Add("EKPPARTIE", OracleType.NVarChar).Value = dwData["EKPPARTIE"].ToString();
            or1.Parameters.Add("EKPSPUL", OracleType.NVarChar).Value = dwData["EKPSPUL"].ToString();
            or1.Parameters.Add("EKPSPULG", OracleType.NVarChar).Value = dwData["EKPSPULG"].ToString();
            or1.Parameters.Add("EKPSPULM", OracleType.NVarChar).Value = dwData["EKPSPULM"].ToString();
            or1.Parameters.Add("EKPVPEINH", OracleType.NVarChar).Value = dwData["EKPVPEINH"].ToString();
            or1.Parameters.Add("EKPAM", OracleType.NVarChar).Value = dwData["EKPAM"].ToString();
            or1.Parameters.Add("EKPZUSAM", OracleType.NVarChar).Value = dwData["EKPZUSAM"].ToString();
            or1.Parameters.Add("EKPHUELSE", OracleType.NVarChar).Value = dwData["EKPHUELSE"].ToString();
            or1.Parameters.Add("EKPKF", OracleType.NVarChar).Value = dwData["EKPKF"].ToString();
            or1.Parameters.Add("EKPFDRES", OracleType.NVarChar).Value = dwData["EKPFDRES"].ToString();
            or1.Parameters.Add("EKPWI", OracleType.NVarChar).Value = dwData["EKPWI"].ToString();
            or1.Parameters.Add("EKPANZTKB", OracleType.NVarChar).Value = dwData["EKPANZTKB"].ToString();
            or1.Parameters.Add("EKPLOSGR", OracleType.NVarChar).Value = dwData["EKPLOSGR"].ToString();
            or1.Parameters.Add("EKPWIRKGEW", OracleType.NVarChar).Value = dwData["EKPWIRKGEW"].ToString();
            or1.Parameters.Add("EKPVKUNDNR", OracleType.NVarChar).Value = dwData["EKPVKUNDNR"].ToString();
            or1.Parameters.Add("EKPVWERK", OracleType.NVarChar).Value = dwData["EKPVWERK"].ToString();
            or1.Parameters.Add("EKPVABT", OracleType.NVarChar).Value = dwData["EKPVABT"].ToString();
            or1.Parameters.Add("EKPVART", OracleType.NVarChar).Value = dwData["EKPVART"].ToString();
            or1.Parameters.Add("EKPVVAR", OracleType.NVarChar).Value = dwData["EKPVVAR"].ToString();
            or1.Parameters.Add("EKPVFARBE", OracleType.NVarChar).Value = dwData["EKPVFARBE"].ToString();
            or1.Parameters.Add("EKPEKUNDNR", OracleType.NVarChar).Value = dwData["EKPEKUNDNR"].ToString();
            or1.Parameters.Add("EKPEWERK", OracleType.NVarChar).Value = dwData["EKPEWERK"].ToString();
            or1.Parameters.Add("EKPEABT", OracleType.NVarChar).Value = dwData["EKPEABT"].ToString();
            or1.Parameters.Add("EKPEART", OracleType.NVarChar).Value = dwData["EKPEART"].ToString();
            or1.Parameters.Add("EKPEVAR", OracleType.NVarChar).Value = dwData["EKPEVAR"].ToString();
            or1.Parameters.Add("EKPEFARBE", OracleType.NVarChar).Value = dwData["EKPEFARBE"].ToString();
            or1.Parameters.Add("EKPEDESS", OracleType.NVarChar).Value = dwData["EKPEDESS"].ToString();
            or1.Parameters.Add("EKPECOL", OracleType.NVarChar).Value = dwData["EKPECOL"].ToString();
            or1.Parameters.Add("EKPEBESCH", OracleType.NVarChar).Value = dwData["EKPEBESCH"].ToString();
            or1.Parameters.Add("EKPEZUSTAND", OracleType.NVarChar).Value = dwData["EKPEZUSTAND"].ToString();
            or1.Parameters.Add("EKPEGROE", OracleType.NVarChar).Value = dwData["EKPEGROE"].ToString();
            or1.Parameters.Add("EKPMINLIME", OracleType.NVarChar).Value = dwData["EKPMINLIME"].ToString();
            or1.Parameters.Add("EKPMINLISP", OracleType.NVarChar).Value = dwData["EKPMINLISP"].ToString();
            or1.Parameters.Add("EKPMEEH", OracleType.NVarChar).Value = dwData["EKPMEEH"].ToString();
            or1.Parameters.Add("EKPMEEHGRP", OracleType.NVarChar).Value = dwData["EKPMEEHGRP"].ToString();
            or1.Parameters.Add("EKPMEEHFKT", OracleType.NVarChar).Value = dwData["EKPMEEHFKT"].ToString();
            or1.Parameters.Add("EKPME1", OracleType.NVarChar).Value = dwData["EKPME1"].ToString();
            or1.Parameters.Add("EKPME2", OracleType.NVarChar).Value = dwData["EKPME2"].ToString();
            or1.Parameters.Add("EKPME3", OracleType.NVarChar).Value = dwData["EKPME3"].ToString();
            or1.Parameters.Add("EKPME4", OracleType.NVarChar).Value = dwData["EKPME4"].ToString();
            or1.Parameters.Add("EKPME5", OracleType.NVarChar).Value = dwData["EKPME5"].ToString();
            or1.Parameters.Add("EKPME6", OracleType.NVarChar).Value = dwData["EKPME6"].ToString();
            or1.Parameters.Add("EKPME7", OracleType.NVarChar).Value = dwData["EKPME7"].ToString();
            or1.Parameters.Add("EKPME8", OracleType.NVarChar).Value = dwData["EKPME8"].ToString();
            or1.Parameters.Add("EKPME9", OracleType.NVarChar).Value = dwData["EKPME9"].ToString();
            or1.Parameters.Add("EKPMEO", OracleType.NVarChar).Value = dwData["EKPMEO"].ToString();
            or1.Parameters.Add("EKPMEU", OracleType.NVarChar).Value = dwData["EKPMEU"].ToString();
            or1.Parameters.Add("EKPSMENGE", OracleType.NVarChar).Value = dwData["EKPSMENGE"].ToString();
            or1.Parameters.Add("EKPWE1", OracleType.NVarChar).Value = dwData["EKPWE1"].ToString();
            or1.Parameters.Add("EKPWE2", OracleType.NVarChar).Value = dwData["EKPWE2"].ToString();
            or1.Parameters.Add("EKPWE3", OracleType.NVarChar).Value = dwData["EKPWE3"].ToString();
            or1.Parameters.Add("EKPWE4", OracleType.NVarChar).Value = dwData["EKPWE4"].ToString();
            or1.Parameters.Add("EKPWE5", OracleType.NVarChar).Value = dwData["EKPWE5"].ToString();
            or1.Parameters.Add("EKPWE6", OracleType.NVarChar).Value = dwData["EKPWE6"].ToString();
            or1.Parameters.Add("EKPWE7", OracleType.NVarChar).Value = dwData["EKPWE7"].ToString();
            or1.Parameters.Add("EKPWE8", OracleType.NVarChar).Value = dwData["EKPWE8"].ToString();
            or1.Parameters.Add("EKPWE9", OracleType.NVarChar).Value = dwData["EKPWE9"].ToString();
            or1.Parameters.Add("EKPBDAT", OracleType.NVarChar).Value = dwData["EKPBDAT"].ToString();
            or1.Parameters.Add("EKPLTERM", OracleType.NVarChar).Value = dwData["EKPLTERM"].ToString();
            or1.Parameters.Add("EKPFIX", OracleType.NVarChar).Value = dwData["EKPFIX"].ToString();
            or1.Parameters.Add("EKPLDAT", OracleType.NVarChar).Value = dwData["EKPLDAT"].ToString();
            or1.Parameters.Add("EKPDRUDAT", OracleType.NVarChar).Value = dwData["EKPDRUDAT"].ToString();
            or1.Parameters.Add("EKPWVTERM", OracleType.NVarChar).Value = dwData["EKPWVTERM"].ToString();
            or1.Parameters.Add("EKPWUTERM", OracleType.NVarChar).Value = dwData["EKPWUTERM"].ToString();
            or1.Parameters.Add("EKPVEINDAT", OracleType.NVarChar).Value = dwData["EKPVEINDAT"].ToString();
            or1.Parameters.Add("EKPVEINDALT", OracleType.NVarChar).Value = dwData["EKPVEINDALT"].ToString();
            or1.Parameters.Add("EKPLTERMBE", OracleType.NVarChar).Value = dwData["EKPLTERMBE"].ToString();
            or1.Parameters.Add("EKPLTERMKZ", OracleType.NVarChar).Value = dwData["EKPLTERMKZ"].ToString();
            or1.Parameters.Add("EKPVTERMIN", OracleType.NVarChar).Value = dwData["EKPVTERMIN"].ToString();
            or1.Parameters.Add("EKPVTERMEIN", OracleType.NVarChar).Value = dwData["EKPVTERMEIN"].ToString();
            or1.Parameters.Add("EKPDATVON", OracleType.NVarChar).Value = dwData["EKPDATVON"].ToString();
            or1.Parameters.Add("EKPBEDAT", OracleType.NVarChar).Value = dwData["EKPBEDAT"].ToString();
            or1.Parameters.Add("EKPTERMTAB", OracleType.NVarChar).Value = dwData["EKPTERMTAB"].ToString();
            or1.Parameters.Add("EKPTERMIND", OracleType.NVarChar).Value = dwData["EKPTERMIND"].ToString();
            or1.Parameters.Add("EKPSOLLDAT1", OracleType.NVarChar).Value = dwData["EKPSOLLDAT1"].ToString();
            or1.Parameters.Add("EKPISTDAT1", OracleType.NVarChar).Value = dwData["EKPISTDAT1"].ToString();
            or1.Parameters.Add("EKPSOLLDAT2", OracleType.NVarChar).Value = dwData["EKPSOLLDAT2"].ToString();
            or1.Parameters.Add("EKPISTDAT2", OracleType.NVarChar).Value = dwData["EKPISTDAT2"].ToString();
            or1.Parameters.Add("EKPSOLLDAT3", OracleType.NVarChar).Value = dwData["EKPSOLLDAT3"].ToString();
            or1.Parameters.Add("EKPISTDAT3", OracleType.NVarChar).Value = dwData["EKPISTDAT3"].ToString();
            or1.Parameters.Add("EKPSOLLDAT4", OracleType.NVarChar).Value = dwData["EKPSOLLDAT4"].ToString();
            or1.Parameters.Add("EKPISTDAT4", OracleType.NVarChar).Value = dwData["EKPISTDAT4"].ToString();
            or1.Parameters.Add("EKPSOLLDAT5", OracleType.NVarChar).Value = dwData["EKPSOLLDAT5"].ToString();
            or1.Parameters.Add("EKPISTDAT5", OracleType.NVarChar).Value = dwData["EKPISTDAT5"].ToString();
            or1.Parameters.Add("EKPSOLLDAT6", OracleType.NVarChar).Value = dwData["EKPSOLLDAT6"].ToString();
            or1.Parameters.Add("EKPISTDAT6", OracleType.NVarChar).Value = dwData["EKPISTDAT6"].ToString();
            or1.Parameters.Add("EKPLRUECK", OracleType.NVarChar).Value = dwData["EKPLRUECK"].ToString();
            or1.Parameters.Add("EKPPRME", OracleType.NVarChar).Value = dwData["EKPPRME"].ToString();
            or1.Parameters.Add("EKPPREH", OracleType.NVarChar).Value = dwData["EKPPREH"].ToString();
            or1.Parameters.Add("EKPPREHGRP", OracleType.NVarChar).Value = dwData["EKPPREHGRP"].ToString();
            or1.Parameters.Add("EKPPREHFKT", OracleType.NVarChar).Value = dwData["EKPPREHFKT"].ToString();
            or1.Parameters.Add("EKPPRDR", OracleType.NVarChar).Value = dwData["EKPPRDR"].ToString();
            or1.Parameters.Add("EKPPREISKZ", OracleType.NVarChar).Value = dwData["EKPPREISKZ"].ToString();
            or1.Parameters.Add("EKPPREISLST", OracleType.NVarChar).Value = dwData["EKPPREISLST"].ToString();
            or1.Parameters.Add("EKPRABATTKZ", OracleType.NVarChar).Value = dwData["EKPRABATTKZ"].ToString();
            or1.Parameters.Add("EKPRABATT", OracleType.NVarChar).Value = dwData["EKPRABATT"].ToString();
            or1.Parameters.Add("EKPRABART1", OracleType.NVarChar).Value = dwData["EKPRABART1"].ToString();
            or1.Parameters.Add("EKPRABPROZ1", OracleType.NVarChar).Value = dwData["EKPRABPROZ1"].ToString();
            or1.Parameters.Add("EKPRABWERT1", OracleType.NVarChar).Value = dwData["EKPRABWERT1"].ToString();
            or1.Parameters.Add("EKPRABART2", OracleType.NVarChar).Value = dwData["EKPRABART2"].ToString();
            or1.Parameters.Add("EKPRABPROZ2", OracleType.NVarChar).Value = dwData["EKPRABPROZ2"].ToString();
            or1.Parameters.Add("EKPRABWERT2", OracleType.NVarChar).Value = dwData["EKPRABWERT2"].ToString();
            or1.Parameters.Add("EKPRABART3", OracleType.NVarChar).Value = dwData["EKPRABART3"].ToString();
            or1.Parameters.Add("EKPRABPROZ3", OracleType.NVarChar).Value = dwData["EKPRABPROZ3"].ToString();
            or1.Parameters.Add("EKPRABWERT3", OracleType.NVarChar).Value = dwData["EKPRABWERT3"].ToString();
            or1.Parameters.Add("EKPRABART4", OracleType.NVarChar).Value = dwData["EKPRABART4"].ToString();
            or1.Parameters.Add("EKPRABPROZ4", OracleType.NVarChar).Value = dwData["EKPRABPROZ4"].ToString();
            or1.Parameters.Add("EKPRABWERT4", OracleType.NVarChar).Value = dwData["EKPRABWERT4"].ToString();
            or1.Parameters.Add("EKPRABART5", OracleType.NVarChar).Value = dwData["EKPRABART5"].ToString();
            or1.Parameters.Add("EKPRABPROZ5", OracleType.NVarChar).Value = dwData["EKPRABPROZ5"].ToString();
            or1.Parameters.Add("EKPRABWERT5", OracleType.NVarChar).Value = dwData["EKPRABWERT5"].ToString();
            or1.Parameters.Add("EKPZUAB1", OracleType.NVarChar).Value = dwData["EKPZUAB1"].ToString();
            or1.Parameters.Add("EKPZUABPR1", OracleType.NVarChar).Value = dwData["EKPZUABPR1"].ToString();
            or1.Parameters.Add("EKPZUABWE1", OracleType.NVarChar).Value = dwData["EKPZUABWE1"].ToString();
            or1.Parameters.Add("EKPZUABME1", OracleType.NVarChar).Value = dwData["EKPZUABME1"].ToString();
            or1.Parameters.Add("EKPABRKZ1", OracleType.NVarChar).Value = dwData["EKPABRKZ1"].ToString();
            or1.Parameters.Add("EKPZUAB2", OracleType.NVarChar).Value = dwData["EKPZUAB2"].ToString();
            or1.Parameters.Add("EKPZUABPR2", OracleType.NVarChar).Value = dwData["EKPZUABPR2"].ToString();
            or1.Parameters.Add("EKPZUABWE2", OracleType.NVarChar).Value = dwData["EKPZUABWE2"].ToString();
            or1.Parameters.Add("EKPZUABME2", OracleType.NVarChar).Value = dwData["EKPZUABME2"].ToString();
            or1.Parameters.Add("EKPABRKZ2", OracleType.NVarChar).Value = dwData["EKPABRKZ2"].ToString();
            or1.Parameters.Add("EKPZUAB3", OracleType.NVarChar).Value = dwData["EKPZUAB3"].ToString();
            or1.Parameters.Add("EKPZUABPR3", OracleType.NVarChar).Value = dwData["EKPZUABPR3"].ToString();
            or1.Parameters.Add("EKPZUABWE3", OracleType.NVarChar).Value = dwData["EKPZUABWE3"].ToString();
            or1.Parameters.Add("EKPZUABME3", OracleType.NVarChar).Value = dwData["EKPZUABME3"].ToString();
            or1.Parameters.Add("EKPABRKZ3", OracleType.NVarChar).Value = dwData["EKPABRKZ3"].ToString();
            or1.Parameters.Add("EKPZUAB4", OracleType.NVarChar).Value = dwData["EKPZUAB4"].ToString();
            or1.Parameters.Add("EKPZUABPR4", OracleType.NVarChar).Value = dwData["EKPZUABPR4"].ToString();
            or1.Parameters.Add("EKPZUABWE4", OracleType.NVarChar).Value = dwData["EKPZUABWE4"].ToString();
            or1.Parameters.Add("EKPZUABME4", OracleType.NVarChar).Value = dwData["EKPZUABME4"].ToString();
            or1.Parameters.Add("EKPABRKZ4", OracleType.NVarChar).Value = dwData["EKPABRKZ4"].ToString();
            or1.Parameters.Add("EKPZUAB5", OracleType.NVarChar).Value = dwData["EKPZUAB5"].ToString();
            or1.Parameters.Add("EKPZUABPR5", OracleType.NVarChar).Value = dwData["EKPZUABPR5"].ToString();
            or1.Parameters.Add("EKPZUABWE5", OracleType.NVarChar).Value = dwData["EKPZUABWE5"].ToString();
            or1.Parameters.Add("EKPZUABME5", OracleType.NVarChar).Value = dwData["EKPZUABME5"].ToString();
            or1.Parameters.Add("EKPABRKZ5", OracleType.NVarChar).Value = dwData["EKPABRKZ5"].ToString();
            or1.Parameters.Add("EKPZUABWERT", OracleType.NVarChar).Value = dwData["EKPZUABWERT"].ToString();
            or1.Parameters.Add("EKPFIXBONP", OracleType.NVarChar).Value = dwData["EKPFIXBONP"].ToString();
            or1.Parameters.Add("EKPFIXBONA", OracleType.NVarChar).Value = dwData["EKPFIXBONA"].ToString();
            or1.Parameters.Add("EKPKALBONP", OracleType.NVarChar).Value = dwData["EKPKALBONP"].ToString();
            or1.Parameters.Add("EKPKALBONA", OracleType.NVarChar).Value = dwData["EKPKALBONA"].ToString();
            or1.Parameters.Add("EKPCOUPON", OracleType.NVarChar).Value = dwData["EKPCOUPON"].ToString();
            or1.Parameters.Add("EKPKOKRS", OracleType.NVarChar).Value = dwData["EKPKOKRS"].ToString();
            or1.Parameters.Add("EKPKOLFD", OracleType.NVarChar).Value = dwData["EKPKOLFD"].ToString();
            or1.Parameters.Add("EKPKOPOS", OracleType.NVarChar).Value = dwData["EKPKOPOS"].ToString();
            or1.Parameters.Add("EKPSTA", OracleType.NVarChar).Value = dwData["EKPSTA"].ToString();
            or1.Parameters.Add("EKPSTAKZ", OracleType.NVarChar).Value = dwData["EKPSTAKZ"].ToString();
            or1.Parameters.Add("EKPMAHNKZ", OracleType.NVarChar).Value = dwData["EKPMAHNKZ"].ToString();
            or1.Parameters.Add("EKPMAHNKZA", OracleType.NVarChar).Value = dwData["EKPMAHNKZA"].ToString();
            or1.Parameters.Add("EKPMAHNDAT", OracleType.NVarChar).Value = dwData["EKPMAHNDAT"].ToString();
            or1.Parameters.Add("EKPKTOKL4", OracleType.NVarChar).Value = dwData["EKPKTOKL4"].ToString();
            or1.Parameters.Add("EKPKSTKRS", OracleType.NVarChar).Value = dwData["EKPKSTKRS"].ToString();
            or1.Parameters.Add("EKPKST", OracleType.NVarChar).Value = dwData["EKPKST"].ToString();
            or1.Parameters.Add("EKPBUDGET", OracleType.NVarChar).Value = dwData["EKPBUDGET"].ToString();
            or1.Parameters.Add("EKPINVAUF", OracleType.NVarChar).Value = dwData["EKPINVAUF"].ToString();
            or1.Parameters.Add("EKPFAUFTYP", OracleType.NVarChar).Value = dwData["EKPFAUFTYP"].ToString();
            or1.Parameters.Add("EKPFAUFKRS", OracleType.NVarChar).Value = dwData["EKPFAUFKRS"].ToString();
            or1.Parameters.Add("EKPFAUFLFD", OracleType.NVarChar).Value = dwData["EKPFAUFLFD"].ToString();
            or1.Parameters.Add("EKPFAUFPOS", OracleType.NVarChar).Value = dwData["EKPFAUFPOS"].ToString();
            or1.Parameters.Add("EKPANRKR", OracleType.NVarChar).Value = dwData["EKPANRKR"].ToString();
            or1.Parameters.Add("EKPALFDNR", OracleType.NVarChar).Value = dwData["EKPALFDNR"].ToString();
            or1.Parameters.Add("EKPWAEHRSL", OracleType.NVarChar).Value = dwData["EKPWAEHRSL"].ToString();
            or1.Parameters.Add("EKPKURS", OracleType.NVarChar).Value = dwData["EKPKURS"].ToString();
            or1.Parameters.Add("EKPBETRAG", OracleType.NVarChar).Value = dwData["EKPBETRAG"].ToString();
            or1.Parameters.Add("EKPHWAEHRSL", OracleType.NVarChar).Value = dwData["EKPHWAEHRSL"].ToString();
            or1.Parameters.Add("EKPHEUROKURS", OracleType.NVarChar).Value = dwData["EKPHEUROKURS"].ToString();
            or1.Parameters.Add("EKPHEUROKURSVK", OracleType.NVarChar).Value = dwData["EKPHEUROKURSVK"].ToString();
            or1.Parameters.Add("EKPFEUROKURS", OracleType.NVarChar).Value = dwData["EKPFEUROKURS"].ToString();
            or1.Parameters.Add("EKPFEUROKURSVK", OracleType.NVarChar).Value = dwData["EKPFEUROKURSVK"].ToString();
            or1.Parameters.Add("EKPTERMNR", OracleType.NVarChar).Value = dwData["EKPTERMNR"].ToString();
            or1.Parameters.Add("EKPFAELLIG", OracleType.NVarChar).Value = dwData["EKPFAELLIG"].ToString();
            or1.Parameters.Add("EKPSICHER", OracleType.NVarChar).Value = dwData["EKPSICHER"].ToString();
            or1.Parameters.Add("EKPSICHP", OracleType.NVarChar).Value = dwData["EKPSICHP"].ToString();
            or1.Parameters.Add("EKPAKKRED", OracleType.NVarChar).Value = dwData["EKPAKKRED"].ToString();
            or1.Parameters.Add("EKPUDATUM", OracleType.NVarChar).Value = dwData["EKPUDATUM"].ToString();
            or1.Parameters.Add("EKPUAENZL", OracleType.NVarChar).Value = dwData["EKPUAENZL"].ToString();
            or1.Parameters.Add("EKPUAENB", OracleType.NVarChar).Value = dwData["EKPUAENB"].ToString();
            or1.Parameters.Add("EKPLIEFNR", OracleType.NVarChar).Value = dwData["EKPLIEFNR"].ToString();
            or1.Parameters.Add("EKPKONDSL", OracleType.NVarChar).Value = dwData["EKPKONDSL"].ToString();
            or1.Parameters.Add("EKPLO", OracleType.NVarChar).Value = dwData["EKPLO"].ToString();
            or1.Parameters.Add("EKPLB", OracleType.NVarChar).Value = dwData["EKPLB"].ToString();
            or1.Parameters.Add("EKPLPLATZ", OracleType.NVarChar).Value = dwData["EKPLPLATZ"].ToString();
            or1.Parameters.Add("EKPLIEFERSCH", OracleType.NVarChar).Value = dwData["EKPLIEFERSCH"].ToString();
            or1.Parameters.Add("EKPZOLLSL", OracleType.NVarChar).Value = dwData["EKPZOLLSL"].ToString();
            or1.Parameters.Add("EKPIMEXSL", OracleType.NVarChar).Value = dwData["EKPIMEXSL"].ToString();
            or1.Parameters.Add("EKPKNTRNRL", OracleType.NVarChar).Value = dwData["EKPKNTRNRL"].ToString();
            or1.Parameters.Add("EKPLIEFKOMP", OracleType.NVarChar).Value = dwData["EKPLIEFKOMP"].ToString();
            or1.Parameters.Add("EKPABRUF", OracleType.NVarChar).Value = dwData["EKPABRUF"].ToString();
            or1.Parameters.Add("EKPSACHB", OracleType.NVarChar).Value = dwData["EKPSACHB"].ToString();
            or1.Parameters.Add("EKPLEBKZ", OracleType.NVarChar).Value = dwData["EKPLEBKZ"].ToString();
            or1.Parameters.Add("EKPSPERR", OracleType.NVarChar).Value = dwData["EKPSPERR"].ToString();
            or1.Parameters.Add("EKPWIEBEST", OracleType.NVarChar).Value = dwData["EKPWIEBEST"].ToString();
            or1.Parameters.Add("EKPBEKZ", OracleType.NVarChar).Value = dwData["EKPBEKZ"].ToString();
            or1.Parameters.Add("EKPPOSTYP", OracleType.NVarChar).Value = dwData["EKPPOSTYP"].ToString();
            or1.Parameters.Add("EKPGESSTA", OracleType.NVarChar).Value = dwData["EKPGESSTA"].ToString();
            or1.Parameters.Add("EKPEINSTA", OracleType.NVarChar).Value = dwData["EKPEINSTA"].ToString();
            or1.Parameters.Add("EKPZENSUR", OracleType.NVarChar).Value = dwData["EKPZENSUR"].ToString();
            or1.Parameters.Add("EKPTEXTKON", OracleType.NVarChar).Value = dwData["EKPTEXTKON"].ToString();
            or1.Parameters.Add("EKPMCODE", OracleType.NVarChar).Value = dwData["EKPMCODE"].ToString();
            or1.Parameters.Add("EKPGENBENID1", OracleType.NVarChar).Value = dwData["EKPGENBENID1"].ToString();
            or1.Parameters.Add("EKPGENDAT1", OracleType.NVarChar).Value = dwData["EKPGENDAT1"].ToString();
            or1.Parameters.Add("EKPGENBENID2", OracleType.NVarChar).Value = dwData["EKPGENBENID2"].ToString();
            or1.Parameters.Add("EKPGENDAT2", OracleType.NVarChar).Value = dwData["EKPGENDAT2"].ToString();
            or1.Parameters.Add("EKPGENBENID3", OracleType.NVarChar).Value = dwData["EKPGENBENID3"].ToString();
            or1.Parameters.Add("EKPGENDAT3", OracleType.NVarChar).Value = dwData["EKPGENDAT3"].ToString();
            or1.Parameters.Add("EKPGENSTUFE", OracleType.NVarChar).Value = dwData["EKPGENSTUFE"].ToString();
            or1.Parameters.Add("EKPGENOFFEN", OracleType.NVarChar).Value = dwData["EKPGENOFFEN"].ToString();
            or1.Parameters.Add("EKPABLADEST", OracleType.NVarChar).Value = dwData["EKPABLADEST"].ToString();
            or1.Parameters.Add("EKPVERBENID", OracleType.NVarChar).Value = dwData["EKPVERBENID"].ToString();
            or1.Parameters.Add("EKPWEMAIL", OracleType.NVarChar).Value = dwData["EKPWEMAIL"].ToString();
            or1.Parameters.Add("EKPURLAND", OracleType.NVarChar).Value = dwData["EKPURLAND"].ToString();
            or1.Parameters.Add("EKPETIDR", OracleType.NVarChar).Value = dwData["EKPETIDR"].ToString();
            or1.Parameters.Add("EKPCHAR", OracleType.NVarChar).Value = dwData["EKPCHAR"].ToString();
            or1.Parameters.Add("EKPGNR", OracleType.NVarChar).Value = dwData["EKPGNR"].ToString();
            or1.Parameters.Add("EKPZUARTF", OracleType.NVarChar).Value = dwData["EKPZUARTF"].ToString();
            or1.Parameters.Add("EKPZUABPRF", OracleType.NVarChar).Value = dwData["EKPZUABPRF"].ToString();
            or1.Parameters.Add("EKPZUABWEF", OracleType.NVarChar).Value = dwData["EKPZUABWEF"].ToString();
            or1.Parameters.Add("EKPMEEHF", OracleType.NVarChar).Value = dwData["EKPMEEHF"].ToString();
            or1.Parameters.Add("EKPABRKZF", OracleType.NVarChar).Value = dwData["EKPABRKZF"].ToString();
            or1.Parameters.Add("EKPZUARTV", OracleType.NVarChar).Value = dwData["EKPZUARTV"].ToString();
            or1.Parameters.Add("EKPZUABPRV", OracleType.NVarChar).Value = dwData["EKPZUABPRV"].ToString();
            or1.Parameters.Add("EKPZUABWEV", OracleType.NVarChar).Value = dwData["EKPZUABWEV"].ToString();
            or1.Parameters.Add("EKPMEEHV", OracleType.NVarChar).Value = dwData["EKPMEEHV"].ToString();
            or1.Parameters.Add("EKPABRKZV", OracleType.NVarChar).Value = dwData["EKPABRKZV"].ToString();
            or1.Parameters.Add("EKPVERSICH", OracleType.NVarChar).Value = dwData["EKPVERSICH"].ToString();
            or1.Parameters.Add("EKPEDIKZ", OracleType.NVarChar).Value = dwData["EKPEDIKZ"].ToString();
            or1.Parameters.Add("EKPKOMMNR", OracleType.NVarChar).Value = dwData["EKPKOMMNR"].ToString();
            or1.Parameters.Add("EKPKOMMPOS", OracleType.NVarChar).Value = dwData["EKPKOMMPOS"].ToString();
            or1.Parameters.Add("EKPEDIDAT", OracleType.NVarChar).Value = dwData["EKPEDIDAT"].ToString();
            or1.Parameters.Add("EKPEDIZEIT", OracleType.NVarChar).Value = dwData["EKPEDIZEIT"].ToString();
            or1.Parameters.Add("EKPURBESTPOS", OracleType.NVarChar).Value = dwData["EKPURBESTPOS"].ToString();
            or1.Parameters.Add("EKPVERTRNRK", OracleType.NVarChar).Value = dwData["EKPVERTRNRK"].ToString();
            or1.Parameters.Add("EKPVERTRPOSK", OracleType.NVarChar).Value = dwData["EKPVERTRPOSK"].ToString();
            or1.Parameters.Add("EKPTERMSTA", OracleType.NVarChar).Value = dwData["EKPTERMSTA"].ToString();
            or1.Parameters.Add("EKPKONTSTA", OracleType.NVarChar).Value = dwData["EKPKONTSTA"].ToString();
            or1.Parameters.Add("EKPZUABSTA", OracleType.NVarChar).Value = dwData["EKPZUABSTA"].ToString();
            or1.Parameters.Add("EKPEXMANDANT", OracleType.NVarChar).Value = dwData["EKPEXMANDANT"].ToString();
            or1.Parameters.Add("EKPWVTERMVG", OracleType.NVarChar).Value = dwData["EKPWVTERMVG"].ToString();
            or1.Parameters.Add("EKPFILLER14", OracleType.NVarChar).Value = dwData["EKPFILLER14"].ToString();
            #endregion
            Connect2Proxy(or1);
        }
        public void UEKP02(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET "
               + "EKPME1=:EKPME1:, EKPPRME=:EKPPRME:, EKPBEKZ=:EKPBEKZ:, EKPVTERMIN=:EKPVTERMIN:, EKPBEDAT=:EKPBEDAT:,"
               + "EKPEART=:EKPEART:,"
               + "EKPEFARBE=:EKPEFARBE:,"
               + "EKPWE1=:EKPWE1:"
               + ",EKPAENB=:EKPAENB:,EKPAENZL=EKPAENZL+1"
               + " WHERE  "
               + "  EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData); or1.CommandText = "UPDATE EKPOS SET EKPAENB=:EKPAENB:,EKPWE1 =TRUNC(EKPME1*EKPPRME*0.001+EKPZUABWERT),EKPWE3 = TRUNC(EKPME3*EKPPRME*0.001+EKPME3/EKPME1*EKPZUABWERT)"
                            + " WHERE     EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UEKP21(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET EKPAENB=:EKPAENB:,EKPWE1 =TRUNC(EKPME1*EKPPRME*0.001+EKPZUABWERT),EKPWE3 = TRUNC(EKPME3*EKPPRME*0.001+EKPME3/EKPME1*EKPZUABWERT)"
                            + " WHERE     EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UEKP03(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET  EKPBEKZ=:EKPBEKZ: ,EKPAENZL=EKPAENZL+1"
                      + " WHERE   EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UEKP04(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET   EKPBEKZ=:EKPBEKZ:,EKPAENZL=EKPAENZL+1,EKPKNTRNRL=:EKPKNTRNRL:"
                     + " WHERE     EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UEKP05(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET EKPLIEFNR=:EKPLIEFNR:,EKPAENZL=EKPAENZL+1 "
                 + " WHERE EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UEKP06(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET EKPWIEBEST=:EKPWIEBEST:,EKPAENZL=EKPAENZL+1,EKPAENB='INTEX   '"
            + " WHERE EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UEKP09(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET EKPLSCOL=:EKPLSCOL: WHERE EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UEKP10(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET EKPSA=:EKPSA:,EKPMANDANT=:EKPMANDANT:,EKPAUFKRS=:EKPAUFKRS:,EKPAUFLFD=:EKPAUFL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ERMKZ:,EKPVTERMIN=:EKPVTERMIN:,EKPVTERMEIN=:EKPVTERMEIN:,EKPDATVON=:EKPDATVON:,EKPBEDAT=:EKPBEDAT:,EKPTERMTAB=:EKPTERMTAB:,EKPTERMIND=:EKPTERMIND:,EKPSOLLDAT1=:EKPSOLLDAT1:,EKPISTDAT1=:EKPISTDAT1:,EKPSOLLDAT2=:EKPSOLLDAT2:,EKPISTDAT2=:EKPISTDAT2:,EKPSOLLDAT3=:EKPSOLLDAT3:,EKPISTDAT3=:EKPISTDAT3:,EKPSOLLDAT4=:EKPSOLLDAT4:,EKPISTDAT4=:EKPISTDAT4:,EKPSOLLDAT5=:EKPSOLLDAT5:,EKPISTDAT5=:EKPISTDAT5:,EKPSOLLDAT6=:EKPSOLLDAT6:,EKPISTDAT6=:EKPISTDAT6:,EKPLRUECK=:EKPLRUECK:,EKPPRME=:EKPPRME:,EKPPREH=:EKPPREH:,EKPPREHGRP=:EKPPREHGRP:,EKPPREHFKT=:EKPPREHFKT:,EKPPRDR=:EKPPRDR:,EKPPREISKZ=:EKPPREISKZ:,EKPPREISLST=:EKPPREISLST:,EKPRABATTKZ=:EKPRABATTKZ:,EKPRABATT=:EKPRABATT:,EKPRABART1=:EKPRABART1:,EKPRABPROZ1=:EKPRABPROZ1:,EKPRABWERT1=:EKPRABWERT1:,EKPRABART2=:EKPRABART2:,EKPRABPROZ2=:EKPRABPROZ2:,EKPRABWERT2=:EKPRABWERT2:,EKPRABART3=:EKPRABART3:,EKPRABPROZ3=:EKPRABPROZ3:,EKPRABWERT3=:EKPRABWERT3:,EKPRABART4=:EKPRABART4:,EKPRABPROZ4=:EKPRABPROZ4:,EKPRABWERT4=:EKPRABWERT4:,EKPRABART5=:EKPRABART5:,EKPRABPROZ5=:EKPRABPROZ5:,EKPRABWERT5=:EKPRABWERT5:,EKPZUAB1=:EKPZUAB1:,EKPZUABPR1=:EKPZUABPR1:,EKPZUABWE1=:EKPZUABWE1:,EKPZUABME1=:EKPZUABME1:,E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,EKPCHAR=:EKPCHAR:,EKPGNR=:EKPGNR:,EKPZUARTF=:EKPZUARTF:,EKPZUABPRF=:EKPZUABPRF:,EKPZUABWEF=:EKPZUABWEF:,EKPMEEHF=:EKPMEEHF:,EKPABRKZF=:EKPABRKZF:,EKPZUARTV=:EKPZUARTV:,EKPZUABPRV=:EKPZUABPRV:,EKPZUABWEV=:EKPZUABWEV:,EKPMEEHV=:EKPMEEHV:,EKPABRKZV=:EKPABRKZV:,EKPVERSICH=:EKPVERSICH:,EKPEDIKZ=:EKPEDIKZ:,EKPKOMMNR=:EKPKOMMNR:,EKPKOMMPOS=:EKPKOMMPOS:,EKPEDIDAT=:EKPEDIDAT:,EKPEDIZEIT=:EKPEDIZEIT:,EKPURBESTPOS=:EKPURBESTPOS:,EKPVERTRNRK=:EKPVERTRNRK:,EKPVERTRPOSK=:EKPVERTRPOSK:,EKPTERMSTA=:EKPTERMSTA:,EKPKONTSTA=:EKPKONTSTA:,EKPZUABSTA=:EKPZUABSTA:,EKPEXMANDANT=:EKPEXMANDANT:,EKPWVTERMVG=:EKPWVTERMVG:,EKPFILLER14=:EKPFILLER14:"
                       + " WHERE EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UEKP11(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET EKPME3=0,EKPWE3=0 "
                + " WHERE EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS: ";
             or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET (EKPME3,EKPWE3)=(SELECT SUM(WBEWMTR)*0.001*100,SUM(WBEWMTR)*0.001*100*EKPWE1/EKPME1 FROM WBBEW WHERE  WBEWAUFTYP='B' AND  WBEWMANDANT=EKPMANDANT AND WBEWAUFKRS=EKPAUFKRS AND WBEWAUFLFD=EKPAUFLFD AND WBEWAUFPOS=EKPAUFPOS AND WBEWBS=11)"
                          + " WHERE EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS: "
                          + " AND EXISTS  (SELECT 1 FROM WBBEW WHERE  WBEWAUFTYP='B' AND  WBEWMANDANT=EKPMANDANT AND WBEWAUFKRS=EKPAUFKRS AND WBEWAUFLFD=EKPAUFLFD AND WBEWAUFPOS=EKPAUFPOS AND WBEWBS=11) ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UEKP12(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET EKPFILLER14=" + date + "||SUBSTR(EKPFILLER14,9,72-8),EKPAENZL=EKPAENZL+1 "
                    + " WHERE EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS: AND EKPME3>=EKPME1";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UEKP13(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET EKPGESSTA=:EKPGESSTA:,EKPFILLER14=" + date + "||SUBSTR(EKPFILLER14,9,72-8) ,EKPAENZL=EKPAENZL+1"
                          + " WHERE EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            /*or1.CommandText = "UPDATE EKPOS SET EKPGESSTA=:EKPGESSTA:,EKPAENZL=EKPAENZL+1"
     + " WHERE EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);*/
            Connect2Proxy(or1);
        }
        public void UEKP14(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET EKPGESSTA=:EKPGESSTA:,EKPAENZL=EKPAENZL+1"
     + " WHERE EKPSA='PO' AND EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD: AND EKPAUFPOS=:EKPAUFPOS: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UEKP20(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE EKPOS SET EKPSA=:EKPSA:,EKPAENB=:EKPAENB:,EKPAEND=:EKPAEND:,EKPAENZL=EKPAENZL+1 "
              + " WHERE EKPSA='PO' AND  EKPMANDANT=:EKPMANDANT: AND EKPAUFKRS=:EKPAUFKRS: AND EKPAUFLFD=:EKPAUFLFD:" + dwData["EKPAUFPOS"].ToString();
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public DataSet QueryEKPOS(string client, string krs, string lfd, int option = 1)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "SELECT * FROM EKPOS WHERE EKPSA<>'AJ' AND  EKPMANDANT=:EKPMANDANT AND EKPAUFKRS=:EKPAUFKRS AND EKPAUFLFD=:EKPAUFLFD ";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = lfd;
                    break;
                default:
                    break;
            }

            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "EKPOS";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
        public DataSet QueryEKPOS(string client, string wakz, string art, string var, string color, int option)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 2://material
                    or1.CommandText = "SELECT * FROM EKPOS WHERE    EKPSA<>'AJ' AND EKPMANDANT=:EKPMANDANT AND EKPWAKZ=:EKPWAKZ   AND utl_raw.cast_to_varchar2(EKPART)=:EKPART AND utl_raw.cast_to_varchar2(EKPVAR)=:EKPVAR  ";
                    or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("EKPWAKZ", OracleType.NVarChar).Value = wakz;
                    or1.Parameters.Add("EKPART", OracleType.NVarChar).Value = art;
                    or1.Parameters.Add("EKPVAR", OracleType.NVarChar).Value = var;
                    break;
                default:
                    break;
            }

            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "EKPOS";
            }
            setReturn.Merge(Result);
            return setReturn;
        }


    }
}